tor-browser

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

11.13.1-1-s-strict.js (708B)


      1 'use strict';
      2 // Copyright (c) 2012 Ecma International.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 es5id: 11.13.1-1-s
      7 description: >
      8    Strict Mode - TypeError is thrown if The LeftHandSide is a
      9    reference to a data property with the attribute value
     10    {[[Writable]]:false} under strict mode
     11 flags: [onlyStrict]
     12 ---*/
     13 
     14        var obj = {};
     15        Object.defineProperty(obj, "prop", {
     16            value: 10,
     17            writable: false,
     18            enumerable: true,
     19            configurable: true
     20        });
     21 assert.throws(TypeError, function() {
     22            obj.prop = 20;
     23 });
     24 assert.sameValue(obj.prop, 10, 'obj.prop');
     25 
     26 reportCompare(0, 0);