Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harness relies on ES6(+) features #3032

Open
p-bakker opened this issue Jun 26, 2021 · 1 comment
Open

Harness relies on ES6(+) features #3032

p-bakker opened this issue Jun 26, 2021 · 1 comment

Comments

@p-bakker
Copy link
Contributor

p-bakker commented Jun 26, 2021

I know most consumers of the test262 probably have a more or less compliant EcmaScript implementation, at least with all the main features implemented, but reality is that there are also some implementations that are behind, for example Rhino (or new implementations might be started from scratch)

While trying to improve Rhino, we keep running into issues where harness code uses >=ES6 features (f.e. unicode regex, default params) which Rhino doesn't support yet (we're working on it though), which causes tests to fail or give false positives

So I'm wondering: shouldn't the harness code refrain from using newer features and stick to ES5 (except for harness code that explicitly tests newer features)?

Just some examples:

  1. nativeFunctionMatcher.js uses the u flag on regexes. Rhino doesn't support those, so any testcase that depends on nativeFunctionMatcher .js fails with a SyntaxError
  2. compareArray.js uses a default parameter value on assert.compareArray
  3. sta.js uses rest params for Thrower

I looked at docs that I could find, but couldn't find any guidance on this particular topic.

Would be great if the harness code could be made compatible with less compliant environments

Or another possibility would be to write the harness code using the latest syntax and features, but use Babel for example to compile it down to ES5. Would be easiest if that down-compiled version would be part of this repo (replacing the current content in /harness). That would be the easiest for us at least, but no idea what others thing of that

@gibson042
Copy link
Contributor

Related: #3196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants