mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
d74ad81402
The addition of assert functions to Userland/js was done before we had load(..) implemented. Now that it exists, it seems like the right move the test helper functions to pure javascript instead of poluting js with random global functions.
17 lines
288 B
JavaScript
17 lines
288 B
JavaScript
load("test-common.js");
|
|
|
|
try {
|
|
assert(typeof this === "object");
|
|
assert(this === globalThis);
|
|
|
|
function Foo() {
|
|
this.x = 5;
|
|
assert(typeof this === "object");
|
|
assert(this.x === 5);
|
|
}
|
|
|
|
new Foo();
|
|
console.log("PASS");
|
|
} catch (err) {
|
|
console.log("FAIL: " + err);
|
|
}
|