diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js b/js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js new file mode 100644 index 0000000000..41f4bfb6c3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js @@ -0,0 +1,45 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-isconcatspreadable +description: > + Revoked proxy value produces a TypeError during access of + `Symbol.isConcatSpreadable` property +info: | + [...] + 5. Repeat, while items is not empty + a. Remove the first element from items and let E be the value of the + element. + b. Let spreadable be ? IsConcatSpreadable(E). + c. If spreadable is true, then + [...] + e. Else E is added as a single item rather than spread, + [...] + + ES6 22.1.3.1.1: Runtime Semantics: IsConcatSpreadable ( O ) + + 1. If Type(O) is not Object, return false. + 2. Let spreadable be ? Get(O, @@isConcatSpreadable). + + 7.3.1 Get + + [...] + 3. Return ? O.[[Get]](P, O). + + 9.5.8 [[Get]] + + [...] + 2. Let handler be O.[[ProxyHandler]]. + 3. If handler is null, throw a TypeError exception. +features: [Proxy] +---*/ + +var handle = Proxy.revocable([], {}); + +handle.revoke(); + +assert.throws(TypeError, function() { + [].concat(handle.proxy); +}, '[].concat(handle.proxy) throws a TypeError exception'); + +reportCompare(0, 0); |