From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../test262/language/module-code/eval-this.js | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 js/src/tests/test262/language/module-code/eval-this.js (limited to 'js/src/tests/test262/language/module-code/eval-this.js') diff --git a/js/src/tests/test262/language/module-code/eval-this.js b/js/src/tests/test262/language/module-code/eval-this.js new file mode 100644 index 0000000000..c269282ffc --- /dev/null +++ b/js/src/tests/test262/language/module-code/eval-this.js @@ -0,0 +1,48 @@ +// |reftest| module +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Module Environment Records provide a this binding, and the value is + `undefined`. +esid: sec-moduleevaluation +info: | + [...] + 16. Let result be the result of evaluating module.[[ECMAScriptCode]]. + [...] + + 12.2.2 The this Keyword + 12.2.2.1 Runtime Semantics: Evaluation + + PrimaryExpression : this + + 1. Return ? ResolveThisBinding( ). + + 8.3.4 ResolveThisBinding ( ) + + 1. Let envRec be GetThisEnvironment( ). + 2. Return ? envRec.GetThisBinding(). + + 8.3.3 GetThisEnvironment ( ) + + 1. Let lex be the running execution context's LexicalEnvironment. + 2. Repeat + a. Let envRec be lex's EnvironmentRecord. + b. Let exists be envRec.HasThisBinding(). + c. If exists is true, return envRec. + d. Let outer be the value of lex's outer environment reference. + e. Let lex be outer. + + 8.1.1.5.3 HasThisBinding () + + 1. Return true. + + 8.1.1.5.4 GetThisBinding () + + 1. Return undefined. +flags: [module] +---*/ + +assert.sameValue(this, undefined); + +reportCompare(0, 0); -- cgit v1.2.3