tor-browser

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

15.2.3.7-6-a-310.js (1290B)


      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.7-6-a-310
      6 description: >
      7    Object.defineProperties - 'O' is an Arguments object, 'P' is
      8    generic own accessor property of 'O', test TypeError is thrown
      9    when updating the [[Get]] attribute value of 'P' which is not
     10    configurable (10.6 [[DefineOwnProperty]] step 4)
     11 includes: [propertyHelper.js]
     12 ---*/
     13 
     14 var arg = (function() {
     15  return arguments;
     16 }(1, 2, 3));
     17 
     18 function getFun() {
     19  return "genericPropertyString";
     20 }
     21 
     22 function setFun(value) {
     23  arg.verifySetFun = value;
     24 }
     25 Object.defineProperty(arg, "genericProperty", {
     26  get: getFun,
     27  set: setFun,
     28  configurable: false
     29 });
     30 
     31 try {
     32  Object.defineProperties(arg, {
     33    "genericProperty": {
     34      get: function() {
     35        return "overideGenericPropertyString";
     36      }
     37    }
     38  });
     39 
     40  throw new Test262Error("Expected an exception.");
     41 } catch (e) {
     42  verifyEqualTo(arg, "genericProperty", getFun());
     43 
     44  verifyWritable(arg, "genericProperty", "verifySetFun");
     45 
     46  if (!(e instanceof TypeError)) {
     47    throw new Test262Error("Expected TypeError, got " + e);
     48  }
     49 }
     50 
     51 verifyProperty(arg, "genericProperty", {
     52  enumerable: false,
     53  configurable: false,
     54 });
     55 
     56 reportCompare(0, 0);