From 0a977a691dc9c9ec4bab049d0c6c1446defaba52 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 21 Aug 2020 13:27:08 -0400 Subject: [PATCH] In strict mode code, attempts to assign to an unresolvable reference must throw a ReferenceError exception. Fixes gh-1964 --- .../assign-to-global-undefined.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/language/identifier-resolution/assign-to-global-undefined.js diff --git a/test/language/identifier-resolution/assign-to-global-undefined.js b/test/language/identifier-resolution/assign-to-global-undefined.js new file mode 100644 index 0000000000..4d6da1438e --- /dev/null +++ b/test/language/identifier-resolution/assign-to-global-undefined.js @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-initializeboundname +description: > + In strict mode code, attempts to assign to an unresolvable reference must throw a ReferenceError exception +info: | + via sec-putvalue + + If IsUnresolvableReference(V) is true, then + If IsStrictReference(V) is true, then + Throw a ReferenceError exception. + +flags: [onlyStrict] +negative: + phase: runtime + type: ReferenceError +---*/ + +undeclared = (this.undeclared = 5);