Debian Codegraph @

js/src/tests/test262/language/expressions/new.target/value-via-member.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-property-accessors-runtime-semantics-evaluation
5 es6id: 12.3.2.1
6 description: Value when invoked via MemberExpression
7 info: |
8 MemberExpression:MemberExpression.IdentifierName
9
10 [...]
11 6. Return a value of type Reference whose base value component is bv, whose
12 referenced name component is propertyNameString, and whose strict
13 reference flag is strict.
14
15 13.5.1 Runtime Semantics: Evaluation
16
17 ExpressionStatement : Expression ;
18
19 1. Let exprRef be the result of evaluating Expression.
20 2. Return ? GetValue(exprRef).
21 features: [new.target]
22 ---*/
23
24 var newTarget = null;
25
26 var obj = {
27 get m() {
28 newTarget = new.target;
29 }
30 };
31
32 obj.m;
33
34 assert.sameValue(newTarget, undefined);
35
36 reportCompare(0, 0);