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
|
ranges: true
|
||||||
};
|
};
|
||||||
|
|
||||||
parseOpts.plugins.jsx = true;
|
if (opts.nonStandard) {
|
||||||
parseOpts.plugins.flow = true;
|
parseOpts.plugins.jsx = true;
|
||||||
|
parseOpts.plugins.flow = true;
|
||||||
|
}
|
||||||
|
|
||||||
var ast = acorn.parse(code, parseOpts);
|
var ast = acorn.parse(code, parseOpts);
|
||||||
|
|
||||||
|
|||||||
@ -395,6 +395,7 @@ export default class File {
|
|||||||
|
|
||||||
var parseOpts = {
|
var parseOpts = {
|
||||||
highlightCode: opts.highlightCode,
|
highlightCode: opts.highlightCode,
|
||||||
|
nonStandard: opts.nonStandard,
|
||||||
filename: opts.filename,
|
filename: opts.filename,
|
||||||
plugins: {}
|
plugins: {}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,8 +15,11 @@
|
|||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"moduleId": {
|
"moduleId": {},
|
||||||
|
|
||||||
|
"nonStandard": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"highlightTheme": {
|
"highlightTheme": {
|
||||||
|
|||||||
@ -28,6 +28,7 @@ _.each(helper.get("generation"), function (testSuite) {
|
|||||||
|
|
||||||
var actualAst = parse({
|
var actualAst = parse({
|
||||||
filename: actual.loc,
|
filename: actual.loc,
|
||||||
|
nonStandard: true,
|
||||||
experimental: true,
|
experimental: true,
|
||||||
strictMode: false,
|
strictMode: false,
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user