unscopables-ignored.js (1449B)
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-global-environment-records-hasbinding-n 5 es6id: 8.1.1.4.1 6 description: > 7 Symbol.unscopables is not referenced for the object environment of the global 8 environment record 9 info: | 10 1. Let envRec be the global Environment Record for which the method was invoked. 11 2. Let DclRec be envRec.[[DeclarativeRecord]]. 12 3. If DclRec.HasBinding(N) is true, return true. 13 4. Let ObjRec be envRec.[[ObjectRecord]]. 14 5. Return ? ObjRec.HasBinding(N). 15 16 8.1.1.2.1 HasBinding 17 18 1. Let envRec be the object Environment Record for which the method was 19 invoked. 20 2. Let bindings be the binding object for envRec. 21 3. Let foundBinding be ? HasProperty(bindings, N). 22 4. If foundBinding is false, return false. 23 5. If the withEnvironment flag of envRec is false, return true. 24 6. Let unscopables be ? Get(bindings, @@unscopables). 25 7. If Type(unscopables) is Object, then 26 a. Let blocked be ToBoolean(? Get(unscopables, N)). 27 b. If blocked is true, return false. 28 8. Return true. 29 features: [Symbol.unscopables] 30 ---*/ 31 32 var callCount = 0; 33 Object.defineProperty(this, Symbol.unscopables, { 34 get: function() { 35 callCount += 1; 36 } 37 }); 38 39 this.test262 = true; 40 41 test262; 42 43 assert.sameValue( 44 callCount, 0, 'Did not reference @@unscopables property of global object' 45 ); 46 47 reportCompare(0, 0);