Closed Bug 1460021 Opened 6 years ago Closed 6 years ago

Resurrect "0in" test

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: sfink, Assigned: sfink)

Details

Attachments

(2 files)

A test from bug 523401 was removed during the transition to the test262/ + non262/ migration, because it had a spec section name in its filename but test262 is lacking a test for that portion of that section of the spec.
Put this test back, at least. I don't know enough about test262 to know whether I should use the old section name (7.8.3), the new one (11.8.3), or a semantic name. So I'm doing the latter.
Attachment #8974113 - Flags: review?(jwalden+bmo)
Comment on attachment 8974113 [details] [diff] [review]
Resurrect "0in" test

Review of attachment 8974113 [details] [diff] [review]:
-----------------------------------------------------------------

You know, you could send a test like this upstream to test262 on Github and then we wouldn't have to carry this around...

::: js/src/tests/non262/literals/numeric/idstart-after-numeric.js
@@ +6,5 @@
> +
> +var array = new Array();
> +assertThrowsInstanceOf(() => eval("array[0for]"), SyntaxError);
> +assertThrowsInstanceOf(() => eval("array[1yield]"), SyntaxError);
> +assertThrowsInstanceOf(() => eval("array[3in]"), SyntaxError);

So the first two tests are syntax errors no matter if the relevant code is there.  The last test is, too.  What's really needed are tests that fail without the id-after testing, pass with.  So add this too:

assertThrowsInstanceOf(() => eval("3in []"), SyntaxError);

That should fail without the original bug-fix, pass with.
Attachment #8974113 - Flags: review?(jwalden+bmo) → review+
Priority: -- → P1
I don't know how all this test262 frontmatter stuff works, so I'm going to submit this for review here but I'll actually end up uploading it to the test262 repo. (Once I figure out where that is and stuff.)

Or maybe you will, if there's some contributor agreement thing or something. :)
Attachment #8974209 - Flags: review?(andrebargull)
Comment on attachment 8974209 [details] [diff] [review]
test262 test file for numeric literal followed by IdentifierStart

Review of attachment 8974209 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Steve Fink [:sfink] [:s:] (PTO June 31) from comment #3)
> Or maybe you will, if there's some contributor agreement thing or something.
> :)

A contributor agreement is necessary to submit to test262, but as a Mozilla employee you don't have to sign an individual agreement and instead can simply state that you're working for Mozilla <https://github.com/tc39/test262#contributing-to-test262>.

::: test/language/literals/numeric/numeric-followed-by-ident.js
@@ +1,1 @@
> +// Copyright (C) 2017 the V8 project authors. All rights reserved.

Copyright (C) 2018 Mozilla. All rights reserved.

@@ +1,5 @@
> +// Copyright (C) 2017 the V8 project authors. All rights reserved.
> +// This code is governed by the BSD license found in the LICENSE file.
> +
> +/*---
> +esid: sec-additional-syntax-numeric-literals

esid: sec-literals-numeric-literals

because the SyntaxError isn't restricted to Annex B and the copied text in the info section below is actually from "sec-literals-numeric-literals", too.

@@ +8,5 @@
> +info: |
> +  The source character immediately following a NumericLiteral must not be an IdentifierStart or DecimalDigit.
> +
> +negative:
> +  phase: early

"early" was almost completely removed in favour of "parse", so this line should read:

  phase: parse
Attachment #8974209 - Flags: review?(andrebargull) → review+
https://hg.mozilla.org/mozilla-central/rev/ff1839757f0c
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: