1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:35:07 +00:00

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.
This commit is contained in:
Matthew Olsson 2020-05-07 17:09:00 -07:00 committed by Andreas Kling
parent cc01933840
commit 532d4bc0ab
6 changed files with 126 additions and 82 deletions

View file

@ -1,4 +1,8 @@
load("test-common.js");
switch (1 + 2) {
case '3':
assertNotReached();
case 3:
console.log("PASS");
break;