tor-browser

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

propertyhelper-verifynotenumerable-enumerable.js (763B)


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