Skip to content

Commit

Permalink
rename the "bigint" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 18, 2022
1 parent 6636f84 commit c090bc4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/compat/js_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
Arrow
AsyncAwait
AsyncGenerator
BigInt
Bigint
Class
ClassField
ClassPrivateAccessor
Expand Down Expand Up @@ -147,7 +147,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Opera: {{start: v{50, 0, 0}}},
Safari: {{start: v{12, 0, 0}}},
},
BigInt: {
Bigint: {
Chrome: {{start: v{67, 0, 0}}},
Edge: {{start: v{79, 0, 0}}},
ES: {{start: v{2020, 0, 0}}},
Expand Down
6 changes: 3 additions & 3 deletions internal/js_parser/js_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ func (p *parser) parseProperty(startLoc logger.Loc, kind js_ast.PropertyKind, op

case js_lexer.TBigIntegerLiteral:
key = js_ast.Expr{Loc: p.lexer.Loc(), Data: &js_ast.EBigInt{Value: p.lexer.Identifier.String}}
p.markSyntaxFeature(compat.BigInt, p.lexer.Range())
p.markSyntaxFeature(compat.Bigint, p.lexer.Range())
p.lexer.Next()

case js_lexer.TPrivateIdentifier:
Expand Down Expand Up @@ -2212,7 +2212,7 @@ func (p *parser) parsePropertyBinding() js_ast.PropertyBinding {

case js_lexer.TBigIntegerLiteral:
key = js_ast.Expr{Loc: p.lexer.Loc(), Data: &js_ast.EBigInt{Value: p.lexer.Identifier.String}}
p.markSyntaxFeature(compat.BigInt, p.lexer.Range())
p.markSyntaxFeature(compat.Bigint, p.lexer.Range())
p.lexer.Next()

case js_lexer.TOpenBracket:
Expand Down Expand Up @@ -3062,7 +3062,7 @@ func (p *parser) parsePrefix(level js_ast.L, errors *deferredErrors, flags exprF

case js_lexer.TBigIntegerLiteral:
value := p.lexer.Identifier
p.markSyntaxFeature(compat.BigInt, p.lexer.Range())
p.markSyntaxFeature(compat.Bigint, p.lexer.Range())
p.lexer.Next()
return js_ast.Expr{Loc: loc, Data: &js_ast.EBigInt{Value: value.String}}

Expand Down
2 changes: 1 addition & 1 deletion internal/js_parser/js_parser_lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (p *parser) markSyntaxFeature(feature compat.JSFeature, r logger.Range) (di
"Using a string as a module namespace identifier name is not supported in %s", where), notes)
return

case compat.BigInt:
case compat.Bigint:
// Transforming these will never be supported
p.log.AddErrorWithNotes(&p.tracker, r, fmt.Sprintf(
"Big integer literals are not available in %s", where), notes)
Expand Down
4 changes: 2 additions & 2 deletions scripts/compat-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const features = {
'Asynchronous Iterators: async generators': { target: 'AsyncGenerator' },
'Asynchronous Iterators: for-await-of loops': { target: 'ForAwait' },
'optional catch binding': { target: 'OptionalCatchBinding' },
'BigInt: basic functionality': { target: 'BigInt' },
'BigInt: basic functionality': { target: 'Bigint' },
'optional chaining operator (?.)': { target: 'OptionalChain' },
'nullish coalescing operator (??)': { target: 'NullishCoalescing' },
'Logical Assignment': { target: 'LogicalAssignment' },
Expand Down Expand Up @@ -160,7 +160,7 @@ mergeVersions('RegExpLookbehindAssertions', { es2018: true })
mergeVersions('RegExpNamedCaptureGroups', { es2018: true })
mergeVersions('RegExpUnicodePropertyEscapes', { es2018: true })
mergeVersions('OptionalCatchBinding', { es2019: true })
mergeVersions('BigInt', { es2020: true })
mergeVersions('Bigint', { es2020: true })
mergeVersions('ImportMeta', { es2020: true })
mergeVersions('NullishCoalescing', { es2020: true })
mergeVersions('OptionalChain', { es2020: true })
Expand Down

0 comments on commit c090bc4

Please sign in to comment.