diff --git a/.jshintrc b/.jshintrc index d9bd925..0fdd54e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,16 +1,18 @@ { - "curly": true, - "eqeqeq": true, - "evil": true, - "forin": true, - "freeze": true, - "immed": true, - "latedef": "nofunc", - "laxbreak": true, - "loopfunc": true, - "noarg": true, - "noempty": true, - "nonew": true, - "trailing": true, - "-W082": false + "curly": true, + "eqeqeq": true, + "evil": true, + "forin": true, + "freeze": true, + "immed": true, + "latedef": "nofunc", + "laxbreak": true, + "loopfunc": true, + "newcap": false, + "noarg": true, + "noempty": true, + "nonew": true, + "trailing": true, + "validthis": true, + "-W082": false } diff --git a/lib/compiler/passes/generate-javascript.js b/lib/compiler/passes/generate-javascript.js index eddf6fd..1268774 100644 --- a/lib/compiler/passes/generate-javascript.js +++ b/lib/compiler/passes/generate-javascript.js @@ -761,6 +761,8 @@ function generateJavascript(ast, options) { parts.push([ '(function() {', + ' "use strict";', + '', ' /*', ' * Generated by PEG.js 0.8.0.', ' *', @@ -1147,7 +1149,7 @@ function generateJavascript(ast, options) { } if (ast.initializer) { - parts.push(indent4("{" + ast.initializer.code + "}")); + parts.push(indent4(ast.initializer.code)); parts.push(''); } diff --git a/lib/parser.js b/lib/parser.js index 48078e6..b6b677f 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,4 +1,6 @@ module.exports = (function() { + "use strict"; + /* * Generated by PEG.js 0.8.0. * @@ -4893,7 +4895,7 @@ module.exports = (function() { return s0; } - { + var OPS_TO_PREFIXED_TYPES = { "$": "text", "&": "simple_and", @@ -4940,7 +4942,7 @@ module.exports = (function() { function buildList(first, rest, index) { return [first].concat(extractList(rest, index)); } - } + peg$result = peg$startRuleFunction();