tor-browser

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

15.2.3.6-4-454.js (994B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es5id: 15.2.3.6-4-454
      6 description: >
      7    ES5 Attributes - fail to update [[Set]] attribute of accessor
      8    property ([[Get]] is undefined, [[Set]] is undefined,
      9    [[Enumerable]] is false, [[Configurable]] is false) to different
     10    value
     11 ---*/
     12 
     13 var obj = {};
     14 
     15 var verifySetFunc = "data";
     16 var setFunc = function(value) {
     17  verifySetFunc = value;
     18 };
     19 
     20 Object.defineProperty(obj, "prop", {
     21  get: undefined,
     22  set: undefined,
     23  enumerable: false,
     24  configurable: false
     25 });
     26 
     27 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
     28 assert.throws(TypeError, function() {
     29  Object.defineProperty(obj, "prop", {
     30    set: setFunc
     31  });
     32 });
     33 var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
     34 assert.sameValue(typeof desc1.set, "undefined", 'typeof desc1.set');
     35 assert.sameValue(typeof desc2.set, "undefined", 'typeof desc2.set');
     36 
     37 reportCompare(0, 0);