Skip to content

Commit bf0ef4a

Browse files
authored
Scopes: Handle *null* for original variable names (#244)
1 parent d69d823 commit bf0ef4a

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

spec.emu

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@
12711271
[[Definition]]: { ... }
12721272
[[Bindings]]: [[
12731273
{
1274-
[{From]]: { [[Line]]: 0, [[Column]]: 0 },
1274+
[[From]]: { [[Line]]: 0, [[Column]]: 0 },
12751275
[[Binding]]: "a",
12761276
},
12771277
{
@@ -1290,7 +1290,7 @@
12901290
<ul>
12911291
<li>[[Definition]] must not be *null*.</li>
12921292
<li>[[Definition]].[[IsStackFrame]] must be *true*.</li>
1293-
<li>[[StackFrameType]] must be ~NONE~.</li>
1293+
<li>[[StackFrameType]] must be ~none~.</li>
12941294
</ul>
12951295

12961296
<emu-clause id="sec-binding-record-type">
@@ -1967,9 +1967,14 @@
19671967
ScopeVariable : Vlq
19681968
</emu-grammar>
19691969
<emu-alg>
1970-
1. TODO: Handle *null* returned by RelativeName.
1971-
1. Return « RelativeName(|Vlq|, _accumulator_, _names_) ».
1970+
1. Let _variable_ be RelativeName(|Vlq|, _accumulator_, _names_).
1971+
1. If _variable_ is *null*, return « "" ».
1972+
1. Return « _variable_ ».
19721973
</emu-alg>
1974+
1975+
<emu-note>
1976+
|OriginalScopeVariables| preserves out-of-bounds indices with the empty string. Otherwise bindings cannot be matched to their respective variable.
1977+
</emu-note>
19731978
</emu-clause>
19741979

19751980
<emu-clause id="sec-RelativeName" type="abstract operation">

0 commit comments

Comments
 (0)