1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:45:07 +00:00

LibJS: Reorganize tests into subfolders

This commit is contained in:
Matthew Olsson 2020-07-02 16:09:21 -07:00 committed by Andreas Kling
parent 21064a1883
commit 4c48c9d69d
213 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,49 @@
load("test-common.js");
try {
assert((function () { }).name === "");
var foo = function () { }
assert(foo.name === "foo");
assert((foo.name = "bar") === "bar");
assert(foo.name === "foo");
var a, b;
a = b = function () { }
assert(a.name === "b");
assert(b.name === "b");
var arr = [
function () { },
function () { },
function () { }
];
assert(arr[0].name === "arr");
assert(arr[1].name === "arr");
assert(arr[2].name === "arr");
var f;
var o = { a: function () { } };
assert(o.a.name === "a");
f = o.a;
assert(f.name === "a");
assert(o.a.name === "a");
o = { ...o, b: f };
assert(o.a.name === "a");
assert(o.b.name === "a");
o.c = function () { };
assert(o.c.name === "c");
function bar() { }
assert(bar.name === "bar");
assert((bar.name = "baz") === "baz");
assert(bar.name === "bar");
assert(console.log.name === "log");
assert((console.log.name = "warn") === "warn");
assert(console.log.name === "log");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}