tor-browser

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

abrupt-completion.js (618B)


      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 /*---
      5 esid: sec-object.freeze
      6 description: >
      7  O.[[PreventExtensions]]() returns abrupt completion.
      8 info: |
      9  Object.freeze ( O )
     10 
     11  ...
     12  2. Let status be ? SetIntegrityLevel(O, frozen).
     13 
     14  SetIntegrityLevel ( O, level )
     15 
     16  ...
     17  3. Let status be ? O.[[PreventExtensions]]().
     18 features: [Proxy]
     19 ---*/
     20 
     21 var p = new Proxy({}, {
     22  preventExtensions: function() {
     23    throw new Test262Error();
     24  },
     25 });
     26 
     27 assert.throws(Test262Error, function() {
     28  Object.freeze(p);
     29 });
     30 
     31 reportCompare(0, 0);