tor-browser

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

propertyhelper-verifyenumerable-not-enumerable-symbol.js (778B)


      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 /*---
      5 description: >
      6    Objects whose specified symbol property is not enumerable do not satisfy the
      7    assertion.
      8 includes: [propertyHelper.js]
      9 features: [Symbol]
     10 ---*/
     11 var threw = false;
     12 var obj = {};
     13 var s = Symbol('1');
     14 Object.defineProperty(obj, s, {
     15  enumerable: false
     16 });
     17 
     18 try {
     19  verifyEnumerable(obj, s);
     20 } catch(err) {
     21  threw = true;
     22  if (err.constructor !== Test262Error) {
     23    throw new Test262Error(
     24      'Expected a Test262Error, but a "' + err.constructor.name +
     25      '" was thrown.'
     26    );
     27  }
     28 }
     29 
     30 if (threw === false) {
     31  throw new Error('Expected a Test262Error, but no error was thrown.');
     32 }
     33 
     34 reportCompare(0, 0);