tor-browser

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

tco-fn-realm-strict.js (744B)


      1 // |reftest| skip -- tail-call-optimization is not supported
      2 'use strict';
      3 // Copyright (C) 2021 the V8 project authors. All rights reserved.
      4 // This code is governed by the BSD license found in the LICENSE file.
      5 /*---
      6 description: >
      7  Realm of the TypeError from invoking a revoked Proxy during tail-call
      8  optimization
      9 esid: sec-tail-position-calls
     10 flags: [onlyStrict]
     11 features: [Proxy, tail-call-optimization]
     12 ---*/
     13 
     14 var other = $262.createRealm();
     15 var F = other.evalScript(`
     16  (function() {
     17    var proxyObj = Proxy.revocable(function() {}, {});
     18    var proxy = proxyObj.proxy;
     19    var revoke = proxyObj.revoke;
     20    revoke();
     21    return proxy();
     22  })
     23 `);
     24 
     25 assert.throws(other.global.TypeError, function() {
     26  F();
     27 });
     28 
     29 reportCompare(0, 0);