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-301.js (1115B)


      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-301
      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 [[Configurable]] attribute value of 'P' which is not
     11    configurable (10.6 [[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  enumerable: true,
     29  configurable: false
     30 });
     31 
     32 try {
     33  Object.defineProperties(arg, {
     34    "0": {
     35      configurable: true
     36    }
     37  });
     38  throw new Test262Error("Expected an exception.");
     39 } catch (e) {
     40  verifyEqualTo(arg, "0", get_func());
     41 
     42  if (!(e instanceof TypeError)) {
     43    throw new Test262Error("Expected TypeError, got " + e);
     44  }
     45 }
     46 
     47 verifyProperty(arg, "0", {
     48  enumerable: true,
     49  configurable: false,
     50 });
     51 
     52 reportCompare(0, 0);