1 // Copyright (C) 2018 Valerie Young. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 esid: sec-assignment-operators-runtime-semantics-evaluation
6 Return abrupt on BigInt
8 Runtime Semantics: Evaluation
9 AssignmentExpression : LeftHandSideExpression = AssignmentExpression
10 1. If LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral, then
12 f. Perform ? PutValue(lref, rval).
17 6. Else if IsPropertyReference(V) is true, then
18 a. If HasPrimitiveBase(V) is true, then
19 i. Assert: In this case, base will never be undefined or null.
20 ii. Set base to ! ToObject(base).
21 b. Let succeeded be ? base.[[Set]](GetReferencedName(V), W, GetThisValue(V)).
22 c. If succeeded is false and IsStrictReference(V) is true, throw a TypeError
26 [[Set]] ( P, V, Receiver )
27 When the [[Set]] internal method of an Integer-Indexed exotic object O is
28 called with property key P, value V, and ECMAScript language value Receiver,
29 the following steps are taken:
30 1. Assert: IsPropertyKey(P) is true.
31 2. If Type(P) is String, then
32 a. Let numericIndex be ! CanonicalNumericIndexString(P).
33 b. If numericIndex is not undefined, then
34 i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
36 IntegerIndexedElementSet ( O, index, value )
37 5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
38 let numValue be ? ToBigInt(value).
39 6. Otherwise, let numValue be ? ToNumber(value).
43 The abstract operation ToNumber converts argument to a value of type Number
48 Result: Throw a TypeError Exception
50 includes: [testTypedArray.js]
51 features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray]
53 testWithTypedArrayConstructors(function(TA) {
54 var typedArray = new TA(1);
56 assert.throws(TypeError, function() {