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-299.js (1183B)


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