Comparing version 1.10.1 to 1.10.2
{ | ||
"name": "esnext", | ||
"version": "1.10.1", | ||
"version": "1.10.2", | ||
"description": "Update your project to the latest ECMAScript syntax.", | ||
@@ -5,0 +5,0 @@ "main": "dist/esnext.umd.js", |
import Module from './module'; | ||
import allPlugins from './plugins/index'; | ||
import estraverse from 'estraverse'; // TODO: import { traverse } from 'estraverse'; | ||
import parse from './utils/parse'; | ||
import shebangRegex from 'shebang-regex'; | ||
import type { RenderedModule } from './module'; | ||
import type { VisitorOption } from 'estraverse'; | ||
import { parse } from 'espree'; | ||
@@ -99,3 +99,3 @@ export { default as run } from './cli'; | ||
try { | ||
parse(code); | ||
parse(code, { sourceType: 'module' }); | ||
return null; | ||
@@ -102,0 +102,0 @@ } catch (ex) { |
import MagicString from 'magic-string'; | ||
import type { Scope } from 'escope'; | ||
import { analyze } from 'escope'; | ||
import parse from './utils/parse'; | ||
import { parse } from 'espree'; | ||
@@ -36,2 +36,9 @@ type Warning = { | ||
const PARSE_OPTIONS = { | ||
loc: true, | ||
range: true, | ||
sourceType: 'module', | ||
tokens: true | ||
}; | ||
export default class Module { | ||
@@ -42,3 +49,3 @@ constructor(id: ?string, source: string) { | ||
this.source = source; | ||
this.ast = parse(source); | ||
this.ast = parse(source, PARSE_OPTIONS); | ||
this.tokens = this.ast.tokens; | ||
@@ -45,0 +52,0 @@ delete this.ast.tokens; |
@@ -239,7 +239,9 @@ import BaseContext from '../context'; | ||
case Syntax.AssignmentExpression: | ||
return { left: node.left, right: node.right }; | ||
if (node.operator === '=') { | ||
return { left: node.left, right: node.right }; | ||
} | ||
break; | ||
} | ||
default: | ||
return null; | ||
} | ||
return null; | ||
} | ||
@@ -246,0 +248,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
212265
25
6320