tor-browser

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

trap-is-not-callable-realm.js (730B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-proxy-object-internal-methods-and-internal-slots-delete-p
      5 description: >
      6  Throws when trap is not callable. (honoring the Realm of the current
      7  execution context)
      8 info: |
      9    9.5.10 [[Delete]] (P)
     10 
     11    6. Let trap be GetMethod(handler, "deleteProperty").
     12    ...
     13 
     14    7.3.9 GetMethod (O, P)
     15 
     16    5. If IsCallable(func) is false, throw a TypeError exception.
     17 features: [cross-realm, Proxy]
     18 ---*/
     19 
     20 var OProxy = $262.createRealm().global.Proxy;
     21 var p = new OProxy({}, {
     22  deleteProperty: {}
     23 });
     24 
     25 assert.throws(TypeError, function() {
     26  delete p.attr;
     27 });
     28 
     29 reportCompare(0, 0);