Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / TypedArrayConstructors / internals / Delete / key-is-not-numeric-index-get-throws.js
blob5035a5d73365e27a0f1f919f7cb89952ed7563b0
1 // Copyright (C) 2020 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-integer-indexed-exotic-objects-delete-p
5 description: >
6   Use OrdinaryDelete if key is not a CanonicalNumericIndex
7 info: |
8   [[Delete]] (P)
10   ...
11   Assert: IsPropertyKey(P) is true.
12   Assert: O is an Integer-Indexed exotic object.
13   If Type(P) is String, then
14     Let numericIndex be ! CanonicalNumericIndexString(P).
15     If numericIndex is not undefined, then
16       If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, return true.
17       If ! IsValidIntegerIndex(O, numericIndex) is false, return true.
18       Return false.
19       ...
20   Return ? OrdinaryDelete(O, P).
22 includes: [testTypedArray.js]
23 features: [align-detached-buffer-semantics-with-web-reality, TypedArray]
24 ---*/
26 testWithTypedArrayConstructors(function(TA) {
27   let sample = new TA(1);
29   Object.defineProperty(sample, "foo", {
30     get() {
31       throw new Test262Error();
32     }
33   });
35   assert.throws(Test262Error, () => {
36     sample.foo;
37   }, '`sample.foo` throws Test262Error');
38 });
40 reportCompare(0, 0);