add nonStandard option - @stefanpenner

This commit is contained in:
Sebastian McKenzie 2015-03-30 06:41:55 +11:00
parent 8e1b6df970
commit 46d991e3e9
4 changed files with 10 additions and 3 deletions

View File

@ -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);

View File

@ -395,6 +395,7 @@ export default class File {
var parseOpts = {
highlightCode: opts.highlightCode,
nonStandard: opts.nonStandard,
filename: opts.filename,
plugins: {}
};

View File

@ -15,8 +15,11 @@
"hidden": true
},
"moduleId": {
"moduleId": {},
"nonStandard": {
"type": "boolean",
"default": true
},
"highlightTheme": {

View File

@ -28,6 +28,7 @@ _.each(helper.get("generation"), function (testSuite) {
var actualAst = parse({
filename: actual.loc,
nonStandard: true,
experimental: true,
strictMode: false,
sourceType: "module",