From d6834acbf1d93a296428bd86f64a6fc838fdd069 Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Tue, 21 Apr 2020 04:43:31 +0300 Subject: [PATCH] Test revoked callable [[ProxyTarget]] --- .../target-is-revoked-function-proxy.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/built-ins/Proxy/revocable/target-is-revoked-function-proxy.js diff --git a/test/built-ins/Proxy/revocable/target-is-revoked-function-proxy.js b/test/built-ins/Proxy/revocable/target-is-revoked-function-proxy.js new file mode 100644 index 0000000000..081a27d792 --- /dev/null +++ b/test/built-ins/Proxy/revocable/target-is-revoked-function-proxy.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-proxycreate +description: > + A Proxy is created with its [[ProxyTarget]] as revoked function Proxy. +info: | + ProxyCreate ( target, handler ) + + [...] + 3. Let P be ! MakeBasicObject(« [[ProxyHandler]], [[ProxyTarget]] »). + [...] + 6. Set P.[[ProxyTarget]] to target. + [...] + 8. Return P. +features: [Proxy] +---*/ + +var revocableTarget = Proxy.revocable(function() {}, {}); +revocableTarget.revoke(); + +var revocable = Proxy.revocable(revocableTarget.proxy, {}); +assert.sameValue(typeof revocable.proxy, "function");