@@ -2936,12 +2936,14 @@ pp$5.parseExprImport = function(forNew) {
2936
2936
// Consume `import` as an identifier for `import.meta`.
2937
2937
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
2938
2938
if ( this . containsEsc ) { this . raiseRecoverable ( this . start , "Escape sequence in keyword import" ) ; }
2939
- var meta = this . parseIdent ( true ) ;
2939
+ this . next ( ) ;
2940
2940
2941
2941
if ( this . type === types$1 . parenL && ! forNew ) {
2942
2942
return this . parseDynamicImport ( node )
2943
2943
} else if ( this . type === types$1 . dot ) {
2944
- node . meta = meta ;
2944
+ var meta = this . startNodeAt ( node . start , node . loc && node . loc . start ) ;
2945
+ meta . name = "import" ;
2946
+ node . meta = this . finishNode ( meta , "Identifier" ) ;
2945
2947
return this . parseImportMeta ( node )
2946
2948
} else {
2947
2949
this . unexpected ( ) ;
@@ -3091,7 +3093,7 @@ pp$5.parseNew = function() {
3091
3093
var node = this . startNode ( ) ;
3092
3094
this . next ( ) ;
3093
3095
if ( this . options . ecmaVersion >= 6 && this . type === types$1 . dot ) {
3094
- var meta = this . startNodeAt ( node . start , node . startLoc ) ;
3096
+ var meta = this . startNodeAt ( node . start , node . loc && node . loc . start ) ;
3095
3097
meta . name = "new" ;
3096
3098
node . meta = this . finishNode ( meta , "Identifier" ) ;
3097
3099
this . next ( ) ;
@@ -5919,7 +5921,7 @@ pp.readWord = function() {
5919
5921
// [walk]: util/walk.js
5920
5922
5921
5923
5922
- var version = "8.11.2 " ;
5924
+ var version = "8.11.3 " ;
5923
5925
5924
5926
Parser . acorn = {
5925
5927
Parser : Parser ,
@@ -5944,11 +5946,10 @@ Parser.acorn = {
5944
5946
} ;
5945
5947
5946
5948
// The main exported interface (under `self.acorn` when in the
5947
- // browser) is a `parse` function that takes a code string and
5948
- // returns an abstract syntax tree as specified by [Mozilla parser
5949
- // API][api].
5949
+ // browser) is a `parse` function that takes a code string and returns
5950
+ // an abstract syntax tree as specified by the [ESTree spec][estree].
5950
5951
//
5951
- // [api ]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
5952
+ // [estree ]: https://github.com/estree/estree
5952
5953
5953
5954
function parse ( input , options ) {
5954
5955
return Parser . parse ( input , options )
0 commit comments