Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7538787
test_not_operator.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
945 B
Referenced Files
None
Subscribers
None
test_not_operator.cjs
View Options
// Test the NOT operator fix
console.log("Test 1 - if (!null) with block:");
if (!null) {
console.log(" PASS");
}
console.log("\nTest 2 - if (!undefined) with block:");
if (!undefined) {
console.log(" PASS");
}
console.log("\nTest 3 - if (!false) with block:");
if (!false) {
console.log(" PASS");
}
console.log("\nTest 4 - if (!0) with block:");
if (!0) {
console.log(" PASS");
}
console.log("\nTest 5 - if (!'') with block:");
if (!'') {
console.log(" PASS");
}
const x = null;
console.log("\nTest 6 - if (!x) return {}:");
function test6() {
if (!x) return {};
return { value: "should not reach" };
}
console.log(" Result:", test6());
console.log("\nTest 7 - if (!handler) return {} from radix3:");
function lookup(handler) {
if (!handler) return {};
return { handler, params: {} };
}
console.log(" With null:", lookup(null));
console.log(" With value:", lookup("test"));
console.log("\nAll tests passed!");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 1:05 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
523974
Default Alt Text
test_not_operator.cjs (945 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment