summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Proxy/revocable/tco-fn-realm-strict.js
blob: 6714f09e633426b73af7414b0f737c0672fc52ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// |reftest| skip -- tail-call-optimization is not supported
'use strict';
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
  Realm of the TypeError from invoking a revoked Proxy during tail-call
  optimization
esid: sec-tail-position-calls
flags: [onlyStrict]
features: [Proxy, tail-call-optimization]
---*/

var other = $262.createRealm();
var F = other.evalScript(`
  (function() {
    var { proxy, revoke } = Proxy.revocable(function() {}, {});
    revoke();
    return proxy();
  })
`);

assert.throws(other.global.TypeError, function() {
  F();
});

reportCompare(0, 0);