tor-browser

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

uses-define-semantics.js (658B)


      1 // Copyright (C) 2018 Kevin Gibbons. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: Uses [[DefineOwnProperty]] rather than [[Set]].
      6 esid: sec-object.fromentries
      7 features: [Object.fromEntries]
      8 ---*/
      9 
     10 Object.defineProperty(Object.prototype, 'property', {
     11  get: function() {
     12    throw new Test262Error('should not trigger getter on Object.prototype');
     13  },
     14  set: function() {
     15    throw new Test262Error('should not trigger setter on Object.prototype');
     16  },
     17 });
     18 
     19 var result = Object.fromEntries([['property', 'value']]);
     20 assert.sameValue(result['property'], 'value', '');
     21 
     22 reportCompare(0, 0);