es-meta / esmeta

ECMAScript Specification (ECMA-262) Metalanguage
BSD 3-Clause "New" or "Revised" License
175 stars 12 forks source link

Fixed minor errors #190

Closed d01c2 closed 9 months ago

d01c2 commented 10 months ago

This PR includes minor error fixes for updating to es2023:

The result of this PR:

fail.json : 661 lines → 37 lines
  1. Typo in rule.json in src/main/resources/manuals/default/:

    - "Return a new Symbol whose [[Description]] is _descString_.": "return (new descString)",
    + "Return a new Symbol whose [[Description]] is _descString_.": "return (new 'descString)",

    which occured many errors including "[InterpreterError] assertion failure: (? argument: \"Object\")". Found by checking INTRINSICS.Symbol.ir:

    def <BUILTIN>:INTRINSICS.Symbol(
    this: ESValue,
    ArgumentsList: List[ESValue],
    NewTarget: Object | Undefined,
    ): Unknown {
    if (< 0 ArgumentsList.length) let description = (pop < ArgumentsList) else let description = absent
    if (! (= NewTarget undefined)) {
    return comp[~throw~/~empty~]((new OrdinaryObject("Prototype" -> @EXECUTION_STACK[0].Realm.Intrinsics["%TypeError.prototype%"], "ErrorData" -> undefined)))
    } else {}
    if (= description undefined) {
    let descString = undefined
    } else {
    call %0 = clo<ToString>(description)
    let descString = [? %0]
    }
    return (new descString()) // should return (new 'descString)
    }
  2. Some errors about equality operation between mathematical value and ±Infinity. For example:

    "[InterpreterError] wrong type for the operator ==: -1.0 and Infinity"

    This error could be fixed by adding some cases in eval function in src/main/scala/esmeta/interpreter/Interpreter.scala:

    + case (Equal, POS_INF, Math(_))     => Bool(false)
    + case (Equal, Math(_), POS_INF)     => Bool(false)
    + case (Equal, NEG_INF, Math(_))     => Bool(false)
    + case (Equal, Math(_), NEG_INF)     => Bool(false)
stonechoe commented 10 months ago

There are two remaining major errors:

  1. Unicode version should be updated.
  2. Test tests/test262/test/language/expressions/equals/bigint-and-number-extremes.js seems to be solved manually in src/main/resources/manuals/default/test262/categorized.json
jhnaldo commented 10 months ago
fail.json : 661 lines → 37 lines

Is it still a valid result?

I performed test262-test on this branch as follows:

esmeta test262-test -test262-test:progress -test262-test:concurrent -test262-test:log

And, the following summary is produced:

- time: 734,509 ms [12:14]
- total: 49,741
  - not-supported (N): 28,753
  - fail (F): 7
  - pass (P): 20,981
- pass-rate: P/P+F = 20,981/20,988 (99.97%)

Only 7 cases failed. Am I missing something?

stonechoe commented 10 months ago

I ran test262-test again with same command and retrieved the following summary with 27 fail tests (which is 35 lines total) of fail.json.

- time: 1,463,729 ms [24:23]
- total: 49,741
  - not-supported (N): 28,743
  - fail (F): 27
  - pass (P): 20,971
- pass-rate: P/P+F = 20,971/20,998 (99.87%)

By comparing fail.json with yours, the only difference was an issue of 'StackOverflowError'. I'm not sure... but maybe this result was occurred from the difference of testing environment.

d01c2 commented 10 months ago

Now, we can retrieve following summary:

- time: 1,783,837 ms [29:43]
- total: 49,741
  - not-supported (N): 28,769
  - fail (F): 1
  - pass (P): 20,971
- pass-rate: P/P+F = 20,971/20,972 (100.00%)

with one remaining error according to fail.json:

{
  "No result when parsing failed" : [
    "language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js"
  ]
}

Should we resolve this error manually?

jhnaldo commented 10 months ago

I checked this test, and it failed when parsing the first parameter {x,} with ObjectBindingPattern. I will let you know how to debug parsing bugs later.

jhnaldo commented 9 months ago

I merged this PR. Thanks! 👍🏻