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.
4 esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
6 Use OrdinarySet if numeric key is not a CanonicalNumericIndex
8 9.4.5.5 [[Set]] ( P, V, Receiver)
11 2. If Type(P) is String, then
12 a. Let numericIndex be ! CanonicalNumericIndexString(P).
13 b. If numericIndex is not undefined, then
15 3. Return ? OrdinarySet(O, P, V, Receiver).
16 includes: [testTypedArray.js]
17 features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
23 "1000000000000000000000",
27 testWithTypedArrayConstructors(function(TA) {
28 keys.forEach(function(key) {
29 var sample = new TA([42]);
32 Reflect.set(sample, key, "ecma262"),
34 'Reflect.set(sample, key, "ecma262") must return true'
36 assert.sameValue(sample[key], "ecma262", 'The value of sample[key] is "ecma262"');
39 Reflect.set(sample, key, "es3000"),
41 'Reflect.set(sample, key, "es3000") must return true'
43 assert.sameValue(sample[key], "es3000", 'The value of sample[key] is "es3000"');
45 Object.defineProperty(sample, key, {
50 Reflect.set(sample, key, 42),
52 'Reflect.set(sample, key, 42) must return false'
55 sample[key], undefined, 'The value of sample[key] is expected to equal `undefined`'