tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

object-keys-binding-uninit.js (1181B)


      1 // |reftest| module
      2 // Copyright (C) 2017 André Bargull. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-object.keys
      7 description: >
      8  Test Object.keys() with uninitialized binding.
      9 info: |
     10  19.1.2.16 Object.keys ( O )
     11    ...
     12    2. Let nameList be ? EnumerableOwnProperties(obj, "key").
     13    ...
     14 
     15  7.3.21 EnumerableOwnProperties ( O, kind )
     16    ...
     17    4. For each element key of ownKeys in List order, do
     18      a. If Type(key) is String, then
     19        i. Let desc be ? O.[[GetOwnProperty]](key).
     20        ...
     21 
     22  9.4.6.4 [[GetOwnProperty]] (P)
     23    ...
     24    4. Let value be ? O.[[Get]](P, O).
     25    ...
     26 
     27  9.4.6.7 [[Get]] (P, Receiver)
     28    ...
     29    12. Let targetEnvRec be targetEnv's EnvironmentRecord.
     30    13. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
     31 
     32  8.1.1.1.6 GetBindingValue ( N, S )
     33    ...
     34    If the binding for N in envRec is an uninitialized binding, throw a ReferenceError exception.
     35    ...
     36 
     37 flags: [module]
     38 ---*/
     39 
     40 import* as self from "./object-keys-binding-uninit.js";
     41 
     42 assert.throws(ReferenceError, function() {
     43  Object.keys(self);
     44 });
     45 
     46 export default 0;
     47 
     48 reportCompare(0, 0);