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-282.js (1074B)


      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-282
      6 description: >
      7    Object.defineProperties - 'O' is an Arguments object, 'P' is own
      8    data property of 'O' which is also defined in [[ParameterMap]] of
      9    'O', test TypeError is thrown when updating the [[Value]]
     10    attribute value of 'P' whose writable and configurable attributes
     11    are false (10.6 [[DefineOwnProperty]] step 4)
     12 includes: [propertyHelper.js]
     13 ---*/
     14 
     15 
     16 var arg;
     17 
     18 (function fun(a, b, c) {
     19  arg = arguments;
     20 }(0, 1, 2));
     21 
     22 Object.defineProperty(arg, "0", {
     23  value: 0,
     24  writable: false,
     25  configurable: false
     26 });
     27 
     28 try {
     29  Object.defineProperties(arg, {
     30    "0": {
     31      value: 10
     32    }
     33  });
     34 
     35  throw new Test262Error("Expected an exception.");
     36 } catch (e) {
     37  if (!(e instanceof TypeError)) {
     38    throw new Test262Error("Expected TypeError, got " + e);
     39  }
     40 }
     41 
     42 verifyProperty(arg, "0", {
     43  value: 0,
     44  writable: false,
     45  enumerable: true,
     46  configurable: false,
     47 });
     48 
     49 reportCompare(0, 0);