ladybird/Libraries/LibJS/Tests/builtins/Array
Linus Groh 0603402c80 LibJS: Handle circular references in Array.prototype.join()
This fixes Array.prototype.{join,toString}() crashing with arrays
containing themselves, i.e. circular references.

The spec is suspiciously silent about this, and indeed engine262, a
"100% spec compliant" ECMA-262 implementation, can't handle these cases.
I had a look at some major engines instead and they all seem to keep
track or check for circular references and return an empty string for
already seen objects.

- SpiderMonkey: "AutoCycleDetector detector(cx, obj)"
- V8: "CycleProtectedArrayJoin<JSArray>(...)"
- JavaScriptCore: "StringRecursionChecker checker(globalObject, thisObject)"
- ChakraCore: "scriptContext->CheckObject(thisArg)"

To keep things simple & consistent this uses the same pattern as
JSONObject, MarkupGenerator and js: simply putting each seen object in a
HashTable<Object*>.

Fixes #3929.
2020-11-04 19:35:43 +01:00
..
array-basic.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-length-setter.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-shrink-during-find-crash.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-simple-and-generic-storage-initialization.js LibJS: Add tests for issue #3382 2020-09-01 21:35:59 +02:00
array-spread.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.from.js LibJS: Implement basic functionality of Array.from() 2020-08-17 21:23:11 +02:00
Array.isArray.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.of.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype-generic-functions.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.concat.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.every.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.fill.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.filter.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.find.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.findIndex.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.forEach.js LibJS: Implement rules for duplicate function parameters 2020-10-25 12:56:02 +01:00
Array.prototype.includes.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.indexOf.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.join.js LibJS: Handle circular references in Array.prototype.join() 2020-11-04 19:35:43 +01:00
Array.prototype.lastIndexOf.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.map.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.pop.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.push.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reduce.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reduceRight.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reverse.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.shift.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.slice.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.some.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.splice.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.toLocaleString.js LibJS: Add Number.prototype.toString 2020-07-15 18:24:55 +02:00
Array.prototype.toString.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.unshift.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.values.js Everywhere: Fix typos 2020-10-02 16:03:17 +02:00