1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:28:12 +00:00

LibJS: Adding two values should convert them to primitives first

This commit is contained in:
Andreas Kling 2020-04-15 09:32:44 +02:00
parent 63499c2c9f
commit fa30355194
3 changed files with 26 additions and 3 deletions

View file

@ -0,0 +1,12 @@
load("test-common.js");
try {
// Note that these will give different results in the REPL due to parsing behavior.
assert([] + [] === "");
assert([] + {} === "[object Object]");
assert({} + {} === "[object Object][object Object]");
assert({} + [] === "[object Object]");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}