tor-browser

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

15.2.3.6-3-3.js (810B)


      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 info: |
      6    The abtract operation ToPropertyDescriptor  is used to package the
      7    into a property desc. Step 10 of ToPropertyDescriptor throws a TypeError
      8    if the property desc ends up having a mix of accessor and data property elements.
      9 es5id: 15.2.3.6-3-3
     10 description: >
     11    Object.defineProperty throws TypeError if desc has 'set' and
     12    'value' present(8.10.5 step 9.a)
     13 ---*/
     14 
     15 var o = {};
     16 
     17 // dummy setter
     18 var setter = function() {}
     19 var desc = {
     20  set: setter,
     21  value: 101
     22 };
     23 assert.throws(TypeError, function() {
     24  Object.defineProperty(o, "foo", desc);
     25 });
     26 assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');
     27 
     28 reportCompare(0, 0);