| Index: src/v8natives.js
|
| diff --git a/src/v8natives.js b/src/v8natives.js
|
| index 4c56fd16efb66a224a94cad9357bd246e3d9b073..9612f16f961a5996d9c93f26b87c63b23fd32075 100644
|
| --- a/src/v8natives.js
|
| +++ b/src/v8natives.js
|
| @@ -925,34 +925,36 @@ function DefineArrayProperty(obj, p, desc, should_throw) {
|
| }
|
|
|
| // Step 4 - Special handling for array index.
|
| - var index = ToUint32(p);
|
| - var emit_splice = false;
|
| - if (ToString(index) == p && index != 4294967295) {
|
| - var length = obj.length;
|
| - if (index >= length && %IsObserved(obj)) {
|
| - emit_splice = true;
|
| - BeginPerformSplice(obj);
|
| - }
|
| + if (!IS_SYMBOL(p)) {
|
| + var index = ToUint32(p);
|
| + var emit_splice = false;
|
| + if (ToString(index) == p && index != 4294967295) {
|
| + var length = obj.length;
|
| + if (index >= length && %IsObserved(obj)) {
|
| + emit_splice = true;
|
| + BeginPerformSplice(obj);
|
| + }
|
|
|
| - var length_desc = GetOwnPropertyJS(obj, "length");
|
| - if ((index >= length && !length_desc.isWritable()) ||
|
| - !DefineObjectProperty(obj, p, desc, true)) {
|
| - if (emit_splice)
|
| + var length_desc = GetOwnPropertyJS(obj, "length");
|
| + if ((index >= length && !length_desc.isWritable()) ||
|
| + !DefineObjectProperty(obj, p, desc, true)) {
|
| + if (emit_splice)
|
| + EndPerformSplice(obj);
|
| + if (should_throw) {
|
| + throw MakeTypeError("define_disallowed", [p]);
|
| + } else {
|
| + return false;
|
| + }
|
| + }
|
| + if (index >= length) {
|
| + obj.length = index + 1;
|
| + }
|
| + if (emit_splice) {
|
| EndPerformSplice(obj);
|
| - if (should_throw) {
|
| - throw MakeTypeError("define_disallowed", [p]);
|
| - } else {
|
| - return false;
|
| + EnqueueSpliceRecord(obj, length, [], index + 1 - length);
|
| }
|
| + return true;
|
| }
|
| - if (index >= length) {
|
| - obj.length = index + 1;
|
| - }
|
| - if (emit_splice) {
|
| - EndPerformSplice(obj);
|
| - EnqueueSpliceRecord(obj, length, [], index + 1 - length);
|
| - }
|
| - return true;
|
| }
|
|
|
| // Step 5 - Fallback to default implementation.
|
|
|