Skip to content

Commit

Permalink
Merge pull request #386 from mozilla/use-strict
Browse files Browse the repository at this point in the history
Use strict
  • Loading branch information
jlongster committed Mar 9, 2015
2 parents 3f83a11 + 459e400 commit 4245822
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bench/run.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var fs = require('fs');
var bench = require('bench');
var oldNunjucks = require('nunjucks');
Expand Down
2 changes: 2 additions & 0 deletions src/compiler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var lib = require('./lib');
var parser = require('./parser');
var transformer = require('./transformer');
Expand Down
2 changes: 2 additions & 0 deletions src/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var path = require('path');
var lib = require('./lib');
var Obj = require('./object');
Expand Down
2 changes: 2 additions & 0 deletions src/filters.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var lib = require('./lib');
var r = require('./runtime');

Expand Down
1 change: 1 addition & 0 deletions src/globals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';

function cycler(items) {
var index = -1;
Expand Down
4 changes: 3 additions & 1 deletion src/lexer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var lib = require('./lib');

var whitespaceChars = ' \n\t\r\u00A0';
Expand Down Expand Up @@ -56,7 +58,7 @@ function Tokenizer(str, opts) {

opts = opts || {};

tags = opts.tags || {};
var tags = opts.tags || {};
this.tags = {
BLOCK_START: tags.blockStart || BLOCK_START,
BLOCK_END: tags.blockEnd || BLOCK_END,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var ArrayProto = Array.prototype;
var ObjProto = Object.prototype;

Expand Down
2 changes: 2 additions & 0 deletions src/loader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var path = require('path');
var Obj = require('./object');
var lib = require('./lib');
Expand Down
2 changes: 2 additions & 0 deletions src/loaders.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

if(typeof window === 'undefined' || window !== this) {
module.exports = require('./node-loaders');
}
Expand Down
2 changes: 2 additions & 0 deletions src/node-loaders.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var fs = require('fs');
var path = require('path');
var lib = require('./lib');
Expand Down
2 changes: 2 additions & 0 deletions src/nodes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var util = require('util');
var lib = require('./lib');
var Object = require('./object');
Expand Down
1 change: 1 addition & 0 deletions src/object.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';

// A simple class system, more documentation to come

Expand Down
2 changes: 2 additions & 0 deletions src/parser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var lexer = require('./lexer');
var nodes = require('./nodes');
var Object = require('./object');
Expand Down
2 changes: 2 additions & 0 deletions src/precompile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var fs = require('fs');
var path = require('path');
var lib = require('./lib');
Expand Down
2 changes: 2 additions & 0 deletions src/runtime.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var lib = require('./lib');
var Obj = require('./object');

Expand Down
2 changes: 2 additions & 0 deletions src/transformer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var nodes = require('./nodes');
var lib = require('./lib');

Expand Down
2 changes: 2 additions & 0 deletions src/web-loaders.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var Loader = require('./loader');

var WebLoader = Loader.extend({
Expand Down
2 changes: 2 additions & 0 deletions tests/api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, Environment, Loader, templatesPath;
var path = require('path');

Expand Down
2 changes: 2 additions & 0 deletions tests/compiler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, util, Environment, Template, fs;

if(typeof require != 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions tests/filters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, util, lib;

if(typeof require != 'undefined') {
Expand Down
4 changes: 3 additions & 1 deletion tests/globals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(function() {
var expect, util, lib;
'use strict';

var expect, util, lib, Environment, Loader, templatesPath;

if(typeof require != 'undefined') {
expect = require('expect.js');
Expand Down
2 changes: 2 additions & 0 deletions tests/lexer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, lib, lexer;

if(typeof require != 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions tests/loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, Environment, Loader, templatesPath;

if(typeof require != 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions tests/parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, lib, nodes, parser;

if(typeof require != 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions tests/runtime.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var expect, util;

if(typeof require != 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions tests/util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function() {
'use strict';

var Environment, Template, loader, templatesPath, expect;

if(typeof require != 'undefined') {
Expand Down

0 comments on commit 4245822

Please sign in to comment.