1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 12:45:06 +00:00
serenity/Libraries/LibJS/Tests/parser-unary-associativity.js
2020-04-02 19:55:45 +02:00

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);
}