tor-browser

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

call-poisoned-underscore-proto.js (602B)


      1 // Copyright (C) 2019 Alexey Shvayka. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: prod-SuperCall
      5 description: >
      6  SuperCall should directly invoke [[GetPrototypeOf]] internal method.
      7 info: |
      8  GetSuperConstructor ( )
      9 
     10  [...]
     11  5. Let superConstructor be ! activeFunction.[[GetPrototypeOf]]().
     12 features: [class]
     13 ---*/
     14 
     15 Object.defineProperty(Object.prototype, '__proto__', {
     16  get: function() {
     17    throw new Test262Error('should not be called');
     18  },
     19 });
     20 
     21 class A extends Array {}
     22 
     23 assert.sameValue(new A(1).length, 1);
     24 
     25 reportCompare(0, 0);