mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 12:45:06 +00:00
20 lines
416 B
JavaScript
20 lines
416 B
JavaScript
function assert(x) { if (!x) throw 1; }
|
|
|
|
try {
|
|
var o = {};
|
|
o.a = 1;
|
|
|
|
assert(o.a === 1);
|
|
assert(!o.a === false);
|
|
assert(!o.a === !(o.a));
|
|
assert(~o.a === ~(o.a));
|
|
assert(+o.a === +(o.a));
|
|
assert(-o.a === -(o.a));
|
|
|
|
assert((typeof "x" === "string") === true);
|
|
assert(!(typeof "x" === "string") === false);
|
|
|
|
console.log("PASS");
|
|
} catch (e) {
|
|
console.log("FAIL: " + e);
|
|
}
|