Skip to content

Commit 656f0cf

Browse files
linusgljharb
authored andcommitted
Editorial: Fix incorrect SetMutableBinding infallibility assumption (#2767)
Example where performing `SetMutableBinding` on `DclRec` would return a throw completion: ```js function f() { x = 1; } f(); // 💥 let x; ``` This is covered by 22 tests in test262 which fail when implemented as written.
1 parent fb5e39a commit 656f0cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11005,7 +11005,7 @@ <h1>
1100511005
<emu-alg>
1100611006
1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]].
1100711007
1. If ! _DclRec_.HasBinding(_N_) is *true*, then
11008-
1. Return ! _DclRec_.SetMutableBinding(_N_, _V_, _S_).
11008+
1. Return ? _DclRec_.SetMutableBinding(_N_, _V_, _S_).
1100911009
1. Let _ObjRec_ be _envRec_.[[ObjectRecord]].
1101011010
1. Return ? <emu-meta effects="user-code">_ObjRec_.SetMutableBinding</emu-meta>(_N_, _V_, _S_).
1101111011
</emu-alg>

0 commit comments

Comments
 (0)