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.
6 Module Environment Records provide a this binding, and the value is
8 esid: sec-moduleevaluation
11 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
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.
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.
36 8.1.1.5.3 HasThisBinding ()
40 8.1.1.5.4 GetThisBinding ()
46 assert.sameValue(this, undefined);