|
36 | 36 | <div class=head>
|
37 | 37 | <h1>asm.js</h1>
|
38 | 38 |
|
39 |
| - <h2 class="no-num no-toc" id=working-draft-22-july-2014>Working Draft — 22 July 2014</h2> |
| 39 | + <h2 class="no-num no-toc" id=working-draft-23-july-2014>Working Draft — 23 July 2014</h2> |
40 | 40 |
|
41 | 41 | <dl>
|
42 | 42 | <dt>Latest version:
|
@@ -77,7 +77,12 @@ <h2 class="no-num no-toc" id=abstract>Abstract</h2>
|
77 | 77 | </p><h3 class="no-num no-toc" id=changelog>Changelog</h3>
|
78 | 78 |
|
79 | 79 | <ul>
|
80 |
| -<li><strong>22 July 2014</strong> |
| 80 | +<li><strong>23 July 2014</strong> |
| 81 | + <ul> |
| 82 | + <li>formatting cleanups |
| 83 | + </li><li>added variadic function types to the Global Types section |
| 84 | + </li></ul> |
| 85 | +</li><li><strong>22 July 2014</strong> |
81 | 86 | <ul>
|
82 | 87 | <li>clarified formal structure with explicit validation rule names
|
83 | 88 | </li><li>moved function table validation from annotations section to validation section
|
@@ -643,6 +648,7 @@ <h3 id=global-types><span class=secno>2.2 </span>Global Types</h3>
|
643 | 648 | <li>value types τ;
|
644 | 649 | </li><li><a href=https://developer.mozilla.org/en-US/docs/JavaScript/Typed_arrays/ArrayBufferView><code>ArrayBufferView</code></a> types <code>Int<em>n</em>Array</code>, <code>Uint<em>n</em>Array</code>, and <code>Float<em>n</em>Array</code>;
|
645 | 650 | </li><li>function types ((σ, …) → τ) ∧ … ∧ ((σ′, …) → τ′);
|
| 651 | +</li><li>variadic function types ((σ, σ<code>…</code>) → τ) ∧ … ∧ ((σ′, σ′<code>…</code>) → τ′); |
646 | 652 | </li><li>function table types ((σ, …) → τ)[<em>n</em>];
|
647 | 653 | </li><li>the special type <code>fround</code> of <code>Math.fround</code>; and
|
648 | 654 | </li><li>the FFI function type <code>Function</code>.
|
@@ -1153,14 +1159,14 @@ <h3 id=validatestatement-s><span class=secno>6.5 </span><em>ValidateStatement</e
|
1153 | 1159 | <p>Validating an <em>IfStatement</em> node
|
1154 | 1160 |
|
1155 | 1161 | </p><div class=example>
|
1156 |
| -<code>if (</code> <em>expr:Expression</em> <code>)</code> <em>stmt1:Statement</em> <code>else</code> <em>stmt2:Statement</em> |
| 1162 | +<code>if (</code> <em>expr:Expression</em> <code>)</code> <em>stmt<sub>1</sub>:Statement</em> <code>else</code> <em>stmt<sub>2</sub>:Statement</em> |
1157 | 1163 | </div>
|
1158 | 1164 |
|
1159 | 1165 | <p>succeeds
|
1160 | 1166 | if <a href=#validateexpression-e><em>ValidateExpression</em></a>
|
1161 | 1167 | succeeds for <em>expr</em> with a subtype of <a href=#int-0><code>int</code></a>
|
1162 | 1168 | and <a href=#validatestatement-s><em>ValidateStatement</em></a>
|
1163 |
| -succeeds for <em>stmt1</em> and <em>stmt2</em>. |
| 1169 | +succeeds for <em>stmt<sub>1</sub></em> and <em>stmt<sub>2</sub></em>. |
1164 | 1170 |
|
1165 | 1171 | </p><p>Validating an <em>IfStatement</em> node
|
1166 | 1172 |
|
@@ -1418,22 +1424,22 @@ <h4>DefaultClause</h4>
|
1418 | 1424 | <p>Validating an <em>Expression</em> node
|
1419 | 1425 |
|
1420 | 1426 | </p><div class=example>
|
1421 |
| -<em>expr1:AssignmentExpression</em> <code>,</code> … <code>,</code> <em>exprn:AssignmentExpression</em> |
| 1427 | +<em>expr<sub>1</sub>:AssignmentExpression</em> <code>,</code> … <code>,</code> <em>expr<sub>n</sub>:AssignmentExpression</em> |
1422 | 1428 | </div>
|
1423 | 1429 |
|
1424 | 1430 | <p>succeeds with type τ if for every <em>i</em>
|
1425 | 1431 | < <em>n</em>, one of the following conditions holds:
|
1426 | 1432 |
|
1427 | 1433 | </p><ul>
|
1428 |
| -<li><em>expri</em> is a <em>CallExpression</em> |
| 1434 | +<li><em>expr<sub>i</sub></em> is a <em>CallExpression</em> |
1429 | 1435 | and <a href=#validatecall-e><em>ValidateCall</em></a> succeeds
|
1430 | 1436 | with actual return type <a href=#void-0><code>void</code></a>; or
|
1431 | 1437 | </li><li><a href=#validateexpression-e><em>ValidateExpression</em></a>
|
1432 |
| -succeeds for <em>expri</em> with some type σ; |
| 1438 | +succeeds for <em>expr<sub>i</sub></em> with some type σ; |
1433 | 1439 | </li></ul>
|
1434 | 1440 |
|
1435 | 1441 | <p>and <a href=#validateexpression-e><em>ValidateExpression</em></a>
|
1436 |
| -succeeds for <em>exprn</em> with type τ. |
| 1442 | +succeeds for <em>expr<sub>n</sub></em> with type τ. |
1437 | 1443 |
|
1438 | 1444 | </p><h4 id=numericliteral><span class=secno>6.8.2 </span>NumericLiteral</h4>
|
1439 | 1445 |
|
|
0 commit comments