Skip to content
Snippets Groups Projects
Commit 19481d38 authored by Brian Terlson's avatar Brian Terlson
Browse files

Use a very negative number so ES5 implementations don't loop forever

parent 68e6a663
No related branches found
No related tags found
No related merge requests found
...@@ -9,14 +9,14 @@ description: Array.prototype.concat array like negative length ...@@ -9,14 +9,14 @@ description: Array.prototype.concat array like negative length
includes: [compareArray.js] includes: [compareArray.js]
---*/ ---*/
var obj = { var obj = {
"length": -6, "length": -4294967294,
"1": "A", "1": "A",
"3": "B", "3": "B",
"5": "C" "5": "C"
}; };
obj[Symbol.isConcatSpreadable] = true; obj[Symbol.isConcatSpreadable] = true;
assert(compareArray([].concat(obj), [])); assert(compareArray([].concat(obj), []));
obj.length = -6.7; obj.length = -4294967294;
assert(compareArray([].concat(obj), [])); assert(compareArray([].concat(obj), []));
obj.length = "-6"; obj.length = "-4294967294";
assert(compareArray([].concat(obj), [])); assert(compareArray([].concat(obj), []));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment