Permalink
Browse files

Try to prevent accidental globals

`mocha --check-leaks` doesn't appear to be very effective, but `'use
strict';` certainly is. Needs a newer version of mocha for the former.
  • Loading branch information...
1 parent d45fccb commit b74569d8f9b2df4a4ea94fdf4390fbb8689c34f7 @squaremo committed Dec 2, 2013
Showing with 14 additions and 2 deletions.
  1. +1 −1 Makefile
  2. +2 −0 index.js
  3. +2 −0 lib/compile.js
  4. +2 −0 lib/constructor.js
  5. +2 −0 lib/interp.js
  6. +2 −0 lib/parse.js
  7. +2 −0 lib/pattern.js
  8. +1 −1 package.json
View
@@ -8,4 +8,4 @@ lib/parser.js:
./node_modules/pegjs/bin/pegjs $(GRAMMAR) $@
test: lib/parser.js
- ./node_modules/.bin/mocha -R list -u tdd
+ ./node_modules/.bin/mocha --check-leaks -R list -u tdd test/*.js
View
@@ -1,3 +1,5 @@
+'use strict';
+
module.exports.parse = require('./lib/parse').parse;
module.exports.match = require('./lib/interp').match;
module.exports.build = require('./lib/constructor').build;
View
@@ -1,5 +1,7 @@
// Compile patterns to recognisers and constructors
+'use strict';
+
require('buffer-more-ints');
var $ = require('util').format;
View
@@ -2,6 +2,8 @@
// Constructors given patterns
+'use strict';
+
var ints = require('buffer-more-ints');
// Interpret the pattern, writing values into a buffer
View
@@ -31,6 +31,8 @@
// bigendian: boolean
// }
+'use strict';
+
var ints = require('buffer-more-ints');
var debug = (process.env.DEBUG) ?
View
@@ -1,6 +1,8 @@
// Parse patterns in string form into the form we use for interpreting
// (and later, for compiling).
+'use strict';
+
var ast = require('./pattern');
var parser = require('./parser');
View
@@ -1,6 +1,8 @@
// -*- js-indent-level: 2 -*-
// Constructing patterns
+'use strict';
+
function set(values) {
var s = {};
for (var i in values) {
View
@@ -23,6 +23,6 @@
},
"devDependencies": {
"pegjs": "0.7.x",
- "mocha": "0.9.x"
+ "mocha": "1.x"
}
}

0 comments on commit b74569d

Please sign in to comment.