Bug 1905259 - Add updated thumbs up and down icons, add CSS animation to active state...
[gecko.git] / js / src / tests / test262 / built-ins / TypedArrayConstructors / internals / Set / key-is-not-numeric-index-set-throws.js
blobae41a4ab80a923a535b598a6dbb914de4a17fc80
1 // |reftest| shell-option(--enable-float16array)
2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
6 description: >
7   Returns abrupt from OrdinarySet when key is not a numeric index
8 info: |
9   9.4.5.5 [[Set]] ( P, V, Receiver)
11   ...
12   2. If Type(P) is String, then
13     a. Let numericIndex be ! CanonicalNumericIndexString(P).
14     b. If numericIndex is not undefined, then
15   ...
16   3. Return ? OrdinarySet(O, P, V, Receiver).
18   9.1.9.1 OrdinarySet (O, P, V, Receiver)
20   ...
21   8. Perform ? Call(setter, Receiver, « V »).
22   ...
23 includes: [testTypedArray.js]
24 features: [align-detached-buffer-semantics-with-web-reality, TypedArray]
25 ---*/
27 testWithTypedArrayConstructors(function(TA) {
28   var sample = new TA(1);
30   Object.defineProperty(sample, "test262", {
31     set: function() {
32       throw new Test262Error();
33     }
34   });
36   assert.throws(Test262Error, function() {
37     sample.test262 = 1;
38   });
40   assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`');
41 });
43 reportCompare(0, 0);