scope-name-lex-close.js (565B)
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-runtime-semantics-classdefinitionevaluation 5 description: Removal of lexical environment for class "name" 6 info: | 7 [...] 8 22. Set the running execution context's LexicalEnvironment to lex. 9 [...] 10 ---*/ 11 12 var C = 'outside'; 13 14 var cls = class C { 15 method() { 16 return C; 17 } 18 }; 19 20 assert.sameValue(cls.prototype.method(), cls, 'from instance method'); 21 assert.sameValue(C, 'outside'); 22 23 reportCompare(0, 0);