Skip to content

Commit

Permalink
Support change-array-by-copy feature (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnaldo committed Oct 29, 2024
1 parent bd65da7 commit 2d19982
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/main/resources/manuals/test262/supported-features.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"async-functions",
"async-iteration",
"caller",
"change-array-by-copy",
"class",
"class-fields-private",
"class-fields-private-in",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/result/complete-funcs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ FieldDefinition[0,1].ClassFieldDefinitionEvaluation
FieldDefinition[0,1].ComputedPropertyContains
FieldDefinition[0,1].PrivateBoundIdentifiers
FieldDefinition[0,1].PropName
FindViaPredicate
ForBinding[0,0].IsDestructuring
ForBinding[1,0].IsDestructuring
ForBodyEvaluation
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/result/spec-summary
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
- numeric string: 17
- syntactic: 195
- extended productions for web: 29
- algorithms: 2773 (88.42%)
- complete: 2452
- incomplete: 321
- algorithm steps: 20530 (96.90%)
- complete: 19894
- incomplete: 636
- algorithms: 2773 (88.46%)
- complete: 2453
- incomplete: 320
- algorithm steps: 20530 (96.91%)
- complete: 19896
- incomplete: 634
- types: 7330 (92.21%)
- known: 6759
- yet: 571
Expand Down
24 changes: 20 additions & 4 deletions src/main/scala/esmeta/interpreter/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,26 @@ object Interpreter {
case (Lt, Math(l), Math(r)) => Bool(l < r)

// extended mathematical value operations
case (Lt, POS_INF, Math(r)) => Bool(false)
case (Lt, Math(r), POS_INF) => Bool(true)
case (Lt, NEG_INF, Math(r)) => Bool(true)
case (Lt, Math(r), NEG_INF) => Bool(false)
case (Add, POS_INF, Math(_)) => POS_INF
case (Add, Math(_), POS_INF) => POS_INF
case (Add, NEG_INF, Math(_)) => NEG_INF
case (Add, Math(_), NEG_INF) => NEG_INF
case (Sub, POS_INF, Math(_)) => POS_INF
case (Sub, Math(_), POS_INF) => NEG_INF
case (Sub, NEG_INF, Math(_)) => NEG_INF
case (Sub, Math(_), NEG_INF) => POS_INF
case (Mul, POS_INF, Math(r)) if r > 0 => POS_INF
case (Mul, POS_INF, Math(r)) if r < 0 => NEG_INF
case (Mul, Math(l), POS_INF) if l > 0 => POS_INF
case (Mul, Math(l), POS_INF) if l < 0 => NEG_INF
case (Mul, NEG_INF, Math(r)) if r > 0 => NEG_INF
case (Mul, NEG_INF, Math(r)) if r < 0 => POS_INF
case (Mul, Math(l), NEG_INF) if l > 0 => NEG_INF
case (Mul, Math(l), NEG_INF) if l < 0 => POS_INF
case (Lt, POS_INF, Math(_)) => Bool(false)
case (Lt, Math(_), POS_INF) => Bool(true)
case (Lt, NEG_INF, Math(_)) => Bool(true)
case (Lt, Math(_), NEG_INF) => Bool(false)

// logical operations
case (And, Bool(l), Bool(r)) => Bool(l && r)
Expand Down

0 comments on commit 2d19982

Please sign in to comment.