Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArrayConstructors / internals / Set / key-is-minus-zero.js
blobc171aa1a3c2f66de768b6f136e2394e693d92e61
1 // Copyright (C) 2016 the V8 project authors. 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-set-p-v-receiver
5 description: >
6   Returns true, even if index is -0
7 info: |
8   9.4.5.5 [[Set]] ( P, V, Receiver)
10   ...
11   2. If Type(P) is String, then
12     a. Let numericIndex be ! CanonicalNumericIndexString(P).
13     b. If numericIndex is not undefined, then
14       i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
15       ii. Return true.
16   ...
18 includes: [testTypedArray.js]
19 features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
20 ---*/
22 testWithTypedArrayConstructors(function(TA) {
23   var sample = new TA([42]);
25   assert.sameValue(Reflect.set(sample, "-0", 1), true, 'Reflect.set(sample, "-0", 1) must return true');
26   assert.sameValue(sample.hasOwnProperty("-0"), false, 'sample.hasOwnProperty("-0") must return false');
27 });
29 reportCompare(0, 0);