Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1547133 - Change .fieldKeys from var to let. r=jorendorff
Browse files Browse the repository at this point in the history
Also fixes bug 1547136.

Differential Revision: https://phabricator.services.mozilla.com/D28928
  • Loading branch information
khyperia committed Apr 30, 2019
1 parent 5944f8c commit 71e5168
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/frontend/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7070,7 +7070,7 @@ GeneralParser<ParseHandler, Unit>::classDefinition(
}

if (numFieldKeys > 0) {
if (!noteDeclaredName(cx_->names().dotFieldKeys, DeclarationKind::Var,
if (!noteDeclaredName(cx_->names().dotFieldKeys, DeclarationKind::Let,
namePos)) {
return null();
}
Expand Down
2 changes: 2 additions & 0 deletions js/src/jit-test/tests/fields/bug1540798.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// |jit-test| --enable-experimental-fields

try { evaluate(`
class constructor { get; } // Long line is long
// Long line XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down
5 changes: 5 additions & 0 deletions js/src/jit-test/tests/fields/bug1547133.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// |jit-test| --enable-experimental-fields

class C47 {
static method(s = class { [y75] = 42; }) {}
}
3 changes: 3 additions & 0 deletions js/src/jit-test/tests/fields/bug1547136.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// |jit-test| --enable-experimental-fields

try {} catch ([ c = class { ["s"] }]) {}

0 comments on commit 71e5168

Please sign in to comment.