|
1374 | 1374 | UnknownItem
|
1375 | 1375 |
|
1376 | 1376 | OriginalScopeStart :
|
1377 |
| - `B` ScopeFlags ScopeLine ScopeColumn ScopeName? ScopeKind? |
| 1377 | + `B` ScopeFlags ScopeLine ScopeColumn ScopeNameOrKind? ScopeKind? |
1378 | 1378 |
|
1379 | 1379 | OriginalScopeEnd :
|
1380 | 1380 | `C` ScopeLine ScopeColumn
|
|
1395 | 1395 | ScopeColumn :
|
1396 | 1396 | Vlq
|
1397 | 1397 |
|
1398 |
| - ScopeName : |
| 1398 | + ScopeNameOrKind : |
1399 | 1399 | Vlq
|
1400 | 1400 |
|
1401 | 1401 | ScopeKind :
|
|
1404 | 1404 | ScopeVariable :
|
1405 | 1405 | Vlq
|
1406 | 1406 | </emu-grammar>
|
1407 |
| - <p>The VLQUnsignedValue of |ScopeFlags| encodes the presence of |ScopeName| and |ScopeKind| and marks the scope as a function:</p> |
| 1407 | + <p>The VLQUnsignedValue of |ScopeFlags| encodes the presence of |ScopeNameOrKind| and |ScopeKind| and marks the scope as a function:</p> |
1408 | 1408 | <emu-table id="table-scope-flags" caption="|ScopeFlags| bits">
|
1409 | 1409 | <table>
|
1410 | 1410 | <thead>
|
|
1415 | 1415 | </thead>
|
1416 | 1416 | <tr>
|
1417 | 1417 | <td>0x1</td>
|
1418 |
| - <td>Set if |ScopeName| is present.</td> |
| 1418 | + <td>|ScopeNameOrKind| is present and contains the scope's name.</td> |
1419 | 1419 | </tr>
|
1420 | 1420 | <tr>
|
1421 | 1421 | <td>0x2</td>
|
1422 |
| - <td>Set if |ScopeKind| is present.</td> |
| 1422 | + <td>If 0x1 is also set, |ScopeKind| is present and contains the scope's kind. If 0x1 is not set, then |ScopeNameOrKind| is present and contains the scope's kind.</td> |
1423 | 1423 | </tr>
|
1424 | 1424 | <tr>
|
1425 | 1425 | <td>0x4</td>
|
|
1628 | 1628 | <tr>
|
1629 | 1629 | <td>[[ScopeNameIndex]]</td>
|
1630 | 1630 | <td>a non-negative Number</td>
|
1631 |
| - <td>|ScopeName|</td> |
| 1631 | + <td>|ScopeNameOrKind|</td> |
1632 | 1632 | </tr>
|
1633 | 1633 | <tr>
|
1634 | 1634 | <td>[[ScopeKindIndex]]</td>
|
1635 | 1635 | <td>a non-negative Number</td>
|
1636 |
| - <td>|ScopeKind|</td> |
| 1636 | + <td>|ScopeNameOrKind| and |ScopeKind|</td> |
1637 | 1637 | </tr>
|
1638 | 1638 | <tr>
|
1639 | 1639 | <td>[[ScopeVariableIndex]]</td>
|
|
1792 | 1792 | </emu-alg>
|
1793 | 1793 | <emu-grammar>
|
1794 | 1794 | OriginalScopeStart :
|
1795 |
| - `B` ScopeFlags ScopeLine ScopeColumn ScopeName? ScopeKind? |
| 1795 | + `B` ScopeFlags ScopeLine ScopeColumn ScopeNameOrKind? ScopeKind? |
1796 | 1796 | </emu-grammar>
|
1797 | 1797 | <emu-alg>
|
1798 | 1798 | 1. Perform DecodeOriginalScopeItem of |ScopeLine| with arguments _scope_, _state_ and _names_.
|
1799 | 1799 | 1. Set _scope_.[[Start]].[[Line]] to _state_.[[ScopeLine]].
|
1800 | 1800 | 1. Perform DecodeOriginalScopeItem of |ScopeColumn| with arguments _scope_, _state_ and _names_.
|
1801 | 1801 | 1. Set _scope_.[[Start]].[[Column]] to _state_.[[ScopeColumn]].
|
1802 | 1802 | 1. Let _flags_ be the VLQUnsignedValue of |ScopeFlags|.
|
1803 |
| - 1. Assert: |ScopeName| is present if and only if, _flags_ & 0x1 = 0x1. |
1804 |
| - 1. If |ScopeName| is present, perform DecodeOriginalScopeItem of |ScopeName| with arguments _scope_, _state_ and _names_. |
1805 |
| - 1. Assert: |ScopeKind| is present if and only if, _flags_ & 0x2 = 0x2. |
1806 |
| - 1. If |ScopeKind| is present, perform DecodeOriginalScopeItem of |ScopeKind| with arguments _scope_, _state_ and _names_. |
| 1803 | + 1. If _flags_ & 0x3 = 0x1, then |
| 1804 | + 1. Assert: |ScopeNameOrKind| is present and |ScopeKind| is not present. |
| 1805 | + 1. DecodeOriginalScopeName(|ScopeNameOrKind|, _scope_, _state_, _names_). |
| 1806 | + 1. Else if _flags_ & 0x3 = 0x2, then |
| 1807 | + 1. Assert: |ScopeNameOrKind| is present and |ScopeKind| is not present. |
| 1808 | + 1. DecodeOriginalScopeKind(|ScopeNameOrKind|, _scope_, _state_, _names_). |
| 1809 | + 1. Else if _flags_ & 0x3 = 0x3, then |
| 1810 | + 1. Assert: |ScopeNameOrKind| is present and |ScopeKind| is present. |
| 1811 | + 1. DecodeOriginalScopeName(|ScopeNameOrKind|, _scope_, _state_, _names_). |
| 1812 | + 1. DecodeOriginalScopeKind(|ScopeKind|, _scope_, _state_, _names_). |
1807 | 1813 | 1. If _flags_ & 0x4 = 0x4, set _scope_.[[IsStackFrame]] to *true*.
|
1808 | 1814 | </emu-alg>
|
1809 | 1815 | <emu-grammar>
|
|
1861 | 1867 | 1. Set _state_.[[ScopeColumn]] to _state_.[[ScopeColumn]] + _relativeColumn_.
|
1862 | 1868 | </emu-alg>
|
1863 | 1869 | <emu-grammar>
|
1864 |
| - ScopeName : |
| 1870 | + ScopeVariable : |
1865 | 1871 | Vlq
|
1866 | 1872 | </emu-grammar>
|
1867 | 1873 | <emu-alg>
|
1868 |
| - 1. Let _relativeName_ be the VLQSignedValue of |Vlq|. |
| 1874 | + 1. Let _relativeVariable_ be the VLQSignedValue of |Vlq|. |
| 1875 | + 1. Set _state_.[[ScopeVariableIndex]] to _state_.[[ScopeVariableIndex]] + _relativeVariable_. |
| 1876 | + 1. Append _names_[_state_.[[ScopeVariableIndex]]] to _scope_.[[Variables]]. |
| 1877 | + </emu-alg> |
| 1878 | + </emu-clause> |
| 1879 | + |
| 1880 | + <emu-clause id="sec-DecodeOriginalScopeName" type="abstract operation"> |
| 1881 | + <h1> |
| 1882 | + DecodeOriginalScopeName ( |
| 1883 | + _name_: a |Vlq| Parse Node, |
| 1884 | + _scope_: a Original Scope Record, |
| 1885 | + _state_: a Decode Scope State Record, |
| 1886 | + _names_: a List of Strings, |
| 1887 | + ) |
| 1888 | + </h1> |
| 1889 | + <dl class="header"></dl> |
| 1890 | + <emu-alg> |
| 1891 | + 1. Let _relativeName_ be the VLQSignedValue of _name_. |
1869 | 1892 | 1. Set _state_.[[ScopeNameIndex]] to _state_.[[ScopeNameIndex]] + _relativeName_.
|
1870 | 1893 | 1. Set _scope_.[[Name]] to _names_[_state_.[[ScopeNameIndex]]].
|
1871 | 1894 | </emu-alg>
|
1872 |
| - <emu-grammar> |
1873 |
| - ScopeKind : |
1874 |
| - Vlq |
1875 |
| - </emu-grammar> |
| 1895 | + </emu-clause> |
| 1896 | + |
| 1897 | + <emu-clause id="sec-DecodeOriginalScopeKind" type="abstract operation"> |
| 1898 | + <h1> |
| 1899 | + DecodeOriginalScopeKind ( |
| 1900 | + _kind_: a |Vlq| Parse Node, |
| 1901 | + _scope_: a Original Scope Record, |
| 1902 | + _state_: a Decode Scope State Record, |
| 1903 | + _names_: a List of Strings, |
| 1904 | + ) |
| 1905 | + </h1> |
| 1906 | + <dl class="header"></dl> |
1876 | 1907 | <emu-alg>
|
1877 |
| - 1. Let _relativeKind_ be the VLQSignedValue of |Vlq|. |
| 1908 | + 1. Let _relativeKind_ be the VLQSignedValue of _kind_. |
1878 | 1909 | 1. Set _state_.[[ScopeKindIndex]] to _state_.[[ScopeKindIndex]] + _relativeKind_.
|
1879 | 1910 | 1. Set _scope_.[[Kind]] to _names_[_state_.[[ScopeKindIndex]]].
|
1880 | 1911 | </emu-alg>
|
1881 |
| - <emu-grammar> |
1882 |
| - ScopeVariable : |
1883 |
| - Vlq |
1884 |
| - </emu-grammar> |
1885 |
| - <emu-alg> |
1886 |
| - 1. Let _relativeVariable_ be the VLQSignedValue of |Vlq|. |
1887 |
| - 1. Set _state_.[[ScopeVariableIndex]] to _state_.[[ScopeVariableIndex]] + _relativeVariable_. |
1888 |
| - 1. Append _names_[_state_.[[ScopeVariableIndex]]] to _scope_.[[Variables]]. |
1889 |
| - </emu-alg> |
1890 | 1912 | </emu-clause>
|
1891 | 1913 | </emu-clause>
|
1892 | 1914 |
|
|
0 commit comments