Add test for normative change to TCO&revoked Proxy

Normative: phrase tail calls as discarding resources rather than popping
execution context stack
https://github.com/tc39/ecma262/pull/2495
This commit is contained in:
Mike Pennisi 2021-09-03 18:50:39 -04:00 committed by Rick Waldron
parent 2a898fe819
commit e9fc3db379
1 changed files with 23 additions and 0 deletions

View File

@ -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();
});