diff --git a/.jshintrc b/.jshintrc index 218394a..0fdd54e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,17 +1,18 @@ { - "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, - "-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 c38d4b8..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.', ' *', diff --git a/lib/parser.js b/lib/parser.js index d402a52..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. *