tor-browser

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

11.13.2-36-s-strict.js (783B)


      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.2-36-s
      7 description: >
      8    Strict Mode - TypeError is thrown if The LeftHandSide of a
      9    Compound Assignment operator(%=) is a reference to an accessor
     10    property with the attribute value {[[Set]]:undefined}
     11 flags: [onlyStrict]
     12 ---*/
     13 
     14        var obj = {};
     15        Object.defineProperty(obj, "prop", {
     16            get: function () {
     17                return 11;
     18            },
     19            set: undefined,
     20            enumerable: true,
     21            configurable: true
     22        });
     23 assert.throws(TypeError, function() {
     24            obj.prop %= 20;
     25 });
     26 assert.sameValue(obj.prop, 11, 'obj.prop');
     27 
     28 reportCompare(0, 0);