Browse Source

Website changes for 'const'

pull/360/head
Sami Vaarala 9 years ago
parent
commit
b5a28bcbb8
  1. 6
      website/guide/custombehavior.html
  2. 17
      website/guide/es6features.html
  3. 4
      website/guide/intro.html

6
website/guide/custombehavior.html

@ -22,6 +22,12 @@ use invalid UTF-8 (<code>0xFF</code> prefix byte).</p>
<p>The <a href="#use-duk-notail">"use duk notail"</a> directive is non-standard. <p>The <a href="#use-duk-notail">"use duk notail"</a> directive is non-standard.
It prevents a function from being tail called.</p> It prevents a function from being tail called.</p>
<h2>"const" treated mostly like "var"</h2>
<p>The <code>const</code> keyword is supported with minimal non-standard
semantics (officially defined in Ecmascript 6). See
<a href="#es6-const">Const variables</a> for more detail.</p>
<h2>The global require() function for module loading</h2> <h2>The global require() function for module loading</h2>
<p>The <code>require()</code> built-in is non-standard, and provided for <p>The <code>require()</code> built-in is non-standard, and provided for

17
website/guide/es6features.html

@ -5,6 +5,23 @@
These features are not fully compliant; the intent is to minimize custom features These features are not fully compliant; the intent is to minimize custom features
and to align with the ES6 specification when possible.</p> and to align with the ES6 specification when possible.</p>
<h2 id="es6-const">Const variables</h2>
<p>Duktape has minimal support for
<a href="http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations">const</a>
declarations to allow existing code using <code>const</code> to run. However,
<code>const</code> is mostly just an alias for <code>var</code> and currently has
the following non-standard semantics:</p>
<ul>
<li>Unlike <code>var</code> declarations, <code>const</code> declarations are
required to have an initializer.</li>
<li>Const variables are writable. In ES6 <code>const</code> variables are
not writable.</li>
<li>Const variables are function scoped and "hoisted" to the top of the
function like <code>var</code> declarations. In ES6 <code>const</code>
has block scoping like <code>let</code>.
</ul>
<h2 id="es6-proto">Object.setPrototypeOf and Object.prototype.__proto__</h2> <h2 id="es6-proto">Object.setPrototypeOf and Object.prototype.__proto__</h2>
<p><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof">Object.setPrototypeOf</a> <p><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof">Object.setPrototypeOf</a>

4
website/guide/intro.html

@ -67,8 +67,8 @@ features (some are visible to applications, while others are internal):</p>
<ul> <ul>
<li>Khronos/ES6 <a href="https://www.khronos.org/registry/typedarray/specs/latest/">TypedArray</a> <li>Khronos/ES6 <a href="https://www.khronos.org/registry/typedarray/specs/latest/">TypedArray</a>
and <a href="https://nodejs.org/docs/v0.12.1/api/buffer.html">Node.js Buffer</a> bindings</li> and <a href="https://nodejs.org/docs/v0.12.1/api/buffer.html">Node.js Buffer</a> bindings</li>
<li>Borrowed from ES6: <code>setPrototypeOf</code>/<code>__proto__</code> <li>Borrowed from ES6: <code>setPrototypeOf</code>/<code>__proto__</code>,
and a subset of <code>Proxy</code> objects</li> a subset of <code>Proxy</code> objects, and minimal <code>const</code> support</li>
<li>Borrowed from browsers: <code>print()</code> and <code>alert()</code></li> <li>Borrowed from browsers: <code>print()</code> and <code>alert()</code></li>
<li>Duktape specific built-ins: provided by the <code>Duktape</code> global object</li> <li>Duktape specific built-ins: provided by the <code>Duktape</code> global object</li>
<li>Extended types: custom "buffer" and "pointer" types, extended string type <li>Extended types: custom "buffer" and "pointer" types, extended string type

Loading…
Cancel
Save