You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, according to latest ECMA-262 specification(https://tc39.es/ecma262/), correct behavior of script above is to throw exception in for - of body.
in step 4, GetMethod throws TypeError and stored in innerResult
in step 6, type of completion is throw, so completion is returned instead of innerResult which contains TypeError.
Although current behavior of GraalJS conforms to ES2020, this was reported as specification bug and patched in latest ECMAScript(related PR: tc39/ecma262#1408).
Furthermore, all the other engines like QuickJS or V8 follow latest ECMAScript.
Test262 also added this behavior in their conformance test suite, so I guess it would be better to follow latest specification rather than ES2020.
GraalVM 20.1.0 (that was used to reproduce this issue) was following the old version of the specification. We adopted the mentioned specification change since then (by 4fc16de) and we pass the mentioned test-case and the related Test262 by now.
OS : macOS ver 10.15.3
Version: GraalVM JavaScript (GraalVM CE Native 20.1.0)
When following JavaScript code is executed, GraalJS throws
TypeError
exception.However, according to latest ECMA-262 specification(https://tc39.es/ecma262/), correct behavior of script above is to throw exception in for - of body.
In "7.4.6 IteratorClose",
status
which is abrupt completion of typethrow
.GetMethod
throwsTypeError
and stored ininnerResult
completion
isthrow
, socompletion
is returned instead ofinnerResult
which containsTypeError
.Although current behavior of GraalJS conforms to ES2020, this was reported as specification bug and patched in latest ECMAScript(related PR: tc39/ecma262#1408).
Furthermore, all the other engines like QuickJS or V8 follow latest ECMAScript.
Test262 also added this behavior in their conformance test suite, so I guess it would be better to follow latest specification rather than ES2020.
Related Test262 test cases :
The text was updated successfully, but these errors were encountered: