ladybird/Libraries/LibJS/Tests/switch-basic.js
Matthew Olsson 532d4bc0ab LibJS: Spec-compliant equality comparisons
The ECMAScript spec defines multiple equality operations which are used
all over the spec; this patch introduces them. Of course, the two
primary equality operations are AbtractEquals ('==') and StrictEquals
('==='), which have been renamed to 'abstract_eq' and 'strict_eq' in
this patch.

In support of the two operations mentioned above, the following have
also been added: SameValue, SameValueZero, and SameValueNonNumeric.
These are important to have, because they are used elsewhere in the spec
aside from the two primary equality comparisons.
2020-05-08 09:49:20 +02:00

14 lines
169 B
JavaScript

load("test-common.js");
switch (1 + 2) {
case '3':
assertNotReached();
case 3:
console.log("PASS");
break;
case 5:
case 1:
break;
default:
break;
}