Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / eval-this.js
blobc269282ffcb1827339679accb6d7eb502a18fd80
1 // |reftest| module
2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: >
6     Module Environment Records provide a this binding, and the value is
7     `undefined`.
8 esid: sec-moduleevaluation
9 info: |
10     [...]
11     16. Let result be the result of evaluating module.[[ECMAScriptCode]].
12     [...]
14     12.2.2 The this Keyword
15     12.2.2.1 Runtime Semantics: Evaluation
17     PrimaryExpression : this
19     1. Return ? ResolveThisBinding( ).
21     8.3.4 ResolveThisBinding ( )
23     1. Let envRec be GetThisEnvironment( ).
24     2. Return ? envRec.GetThisBinding().
26     8.3.3 GetThisEnvironment ( )
28     1. Let lex be the running execution context's LexicalEnvironment.
29     2. Repeat
30        a. Let envRec be lex's EnvironmentRecord.
31        b. Let exists be envRec.HasThisBinding().
32        c. If exists is true, return envRec.
33        d. Let outer be the value of lex's outer environment reference.
34        e. Let lex be outer.
36     8.1.1.5.3 HasThisBinding ()
38     1. Return true.
40     8.1.1.5.4 GetThisBinding ()
42     1. Return undefined.
43 flags: [module]
44 ---*/
46 assert.sameValue(this, undefined);
48 reportCompare(0, 0);