Fix #4451: Treat default as a keyword in an export statement only when it follows export or as

This commit is contained in:
Geoffrey Booth
2017-04-02 17:36:25 -07:00
parent ca0fd229e1
commit 98d1644c5b
3 changed files with 15 additions and 7 deletions

View File

@@ -127,7 +127,7 @@ exports.Lexer = class Lexer
if id is 'as' and @seenExport and @tag() is 'IDENTIFIER'
@token 'AS', id
return id.length
if id is 'default' and @seenExport
if id is 'default' and @seenExport and @tag() in ['EXPORT', 'AS']
@token 'DEFAULT', id
return id.length