put experimental ES7 features behind a flag --experimental and experimental option

This commit is contained in:
Sebastian McKenzie
2014-11-21 19:36:35 +11:00
parent 8b46cce466
commit bd91bbee71
12 changed files with 62 additions and 43 deletions

View File

@@ -218,7 +218,7 @@ exports.parse = function (opts, code, callback) {
var ast = acorn.parse(code, {
allowReturnOutsideFunction: true,
preserveParens: true,
ecmaVersion: Infinity,
ecmaVersion: opts.experimental ? 7 : 6,
strictMode: true,
onComment: comments,
locations: true,