tor-browser

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

propertyhelper-verifynotwritable-not-writable-strict.js (503B)


      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 property is not writable satisfy the assertion.
      7 includes: [propertyHelper.js]
      8 ---*/
      9 
     10 var obj = {};
     11 
     12 Object.defineProperty(obj, 'a', {
     13  writable: false,
     14  value: 123
     15 });
     16 
     17 verifyNotWritable(obj, 'a');
     18 
     19 if (obj.a !== 123) {
     20  throw new Error('`verifyNotWritable` should be non-destructive.');
     21 }
     22 
     23 reportCompare(0, 0);