add nonStandard option - @stefanpenner
This commit is contained in:
parent
8e1b6df970
commit
46d991e3e9
@ -22,8 +22,10 @@ export default function (opts, code, callback) {
|
||||
ranges: true
|
||||
};
|
||||
|
||||
parseOpts.plugins.jsx = true;
|
||||
parseOpts.plugins.flow = true;
|
||||
if (opts.nonStandard) {
|
||||
parseOpts.plugins.jsx = true;
|
||||
parseOpts.plugins.flow = true;
|
||||
}
|
||||
|
||||
var ast = acorn.parse(code, parseOpts);
|
||||
|
||||
|
||||
@ -395,6 +395,7 @@ export default class File {
|
||||
|
||||
var parseOpts = {
|
||||
highlightCode: opts.highlightCode,
|
||||
nonStandard: opts.nonStandard,
|
||||
filename: opts.filename,
|
||||
plugins: {}
|
||||
};
|
||||
|
||||
@ -15,8 +15,11 @@
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
"moduleId": {
|
||||
"moduleId": {},
|
||||
|
||||
"nonStandard": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
|
||||
"highlightTheme": {
|
||||
|
||||
@ -28,6 +28,7 @@ _.each(helper.get("generation"), function (testSuite) {
|
||||
|
||||
var actualAst = parse({
|
||||
filename: actual.loc,
|
||||
nonStandard: true,
|
||||
experimental: true,
|
||||
strictMode: false,
|
||||
sourceType: "module",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user