fix strictMode option

This commit is contained in:
Sebastian McKenzie 2015-02-08 16:06:32 +11:00
parent 06c4334808
commit ce7abeab18

View File

@ -45,6 +45,9 @@
initTokenState();
var startPos = options.locations ? [tokPos, curPosition()] : tokPos;
initParserState();
if (options.strictMode) {
strict = true;
}
return parseTopLevel(options.program || startNodeAt(startPos));
};
@ -52,6 +55,7 @@
// the parser process. These options are recognized:
var defaultOptions = exports.defaultOptions = {
strictMode: false,
playground: false,
// `ecmaVersion` indicates the ECMAScript version to parse. Must
// be either 3, or 5, or 6. This influences support for strict
@ -172,9 +176,6 @@
comments.push(comment);
};
}
if (options.strictMode) {
strict = true;
}
if (options.ecmaVersion >= 6) {
isKeyword = isEcma6Keyword;
} else {