Skip to content

Commit

Permalink
Add test for normative change to TCO&revoked Proxy
Browse files Browse the repository at this point in the history
Normative: phrase tail calls as discarding resources rather than popping
execution context stack
tc39/ecma262#2495
  • Loading branch information
jugglinmike authored and rwaldron committed Sep 7, 2021
1 parent 2a898fe commit e9fc3db
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/built-ins/Proxy/revocable/tco-fn-realm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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();
});

0 comments on commit e9fc3db

Please sign in to comment.