Previously, when "this" argument was not a fast array, but the "deleted" array
was a fast array, the "deleted" array may be left in uninitialized state if
"this" argument had gaps.
This fix is to ensure that "deleted" is properly initialized.
This fixes #485 issue on Github.
if (njs_slow_path(ret == NJS_ERROR)) {
return ret;
}
+
+ } else {
+ if (deleted->object.fast_array) {
+ njs_set_invalid(&deleted->start[i]);
+ }
}
}
"Array.prototype.splice.call(obj, 2**53-2, 0, 'C');"),
njs_str("TypeError: Invalid length") },
+ { njs_str("var a = {1: 'B', length: 2};"
+ "Array.prototype.splice.call(a, 0)"),
+ njs_str(",B") },
+
+ { njs_str("var a = new Uint8Array();"
+ "a.__proto__ = [1,2,3];"
+ "a.splice(0)"),
+ njs_str(",,") },
+
{ njs_str("var a = []; a.reverse()"),
njs_str("") },