diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/toString/proxy-function-async.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Object/prototype/toString/proxy-function-async.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/toString/proxy-function-async.js b/js/src/tests/test262/built-ins/Object/prototype/toString/proxy-function-async.js new file mode 100644 index 0000000000..094b7c0e70 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/toString/proxy-function-async.js @@ -0,0 +1,34 @@ +// Copyright (C) 2019 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.prototype.tostring +description: Proxy of async function is treated as a function. +info: | + ProxyCreate ( target, handler ) + + [...] + 7. If IsCallable(target) is true, then + a. Set P.[[Call]] as specified in 9.5.12. + + Object.prototype.toString ( ) + + [...] + 7. Else if O has a [[Call]] internal method, let builtinTag be "Function". +features: [async-functions, Proxy, Symbol.toStringTag] +---*/ + +var asyncProxy = new Proxy(async function() {}, {}); +var asyncProxyProxy = new Proxy(asyncProxy, {}); + +assert.sameValue( + Object.prototype.toString.call(asyncProxy), + '[object AsyncFunction]', + 'async function proxy' +); +assert.sameValue( + Object.prototype.toString.call(asyncProxyProxy), + '[object AsyncFunction]', + 'proxy for async function proxy' +); + +reportCompare(0, 0); |