Permalink
Browse files

Remove function wrapping and all |global| refrences from helpers.js

Originally I wanted to be very explicit with accesses to global object,
but since all this file is about extending it, the |global.| qualifier
seems more like noise.
  • Loading branch information...
1 parent f0eab47 commit cfc60410416814a92052a2edf6f92f888c5165a0 @dmajda dmajda committed Feb 13, 2011
Showing with 12 additions and 16 deletions.
  1. +12 −16 test/helpers.js
View
@@ -1,14 +1,12 @@
-(function(global) {
-
-global.parses = function(parser, input, expected) {
+parses = function(parser, input, expected) {
deepEqual(parser.parse(input), expected);
};
-global.doesNotParse = function(parser, input) {
+doesNotParse = function(parser, input) {
raises(function() { parser.parse(input); }, parser.SyntaxError);
};
-global.doesNotParseWithMessage = function(parser, input, message) {
+doesNotParseWithMessage = function(parser, input, message) {
raises(
function() { parser.parse(input); },
function(e) {
@@ -17,7 +15,7 @@ global.doesNotParseWithMessage = function(parser, input, message) {
);
};
-global.doesNotParseWithPos = function(parser, input, line, column) {
+doesNotParseWithPos = function(parser, input, line, column) {
raises(
function() { parser.parse(input); },
function(e) {
@@ -28,16 +26,14 @@ global.doesNotParseWithPos = function(parser, input, line, column) {
);
};
-global.parserParses = function(input, expected) {
- global.parses(PEG.parser, input, expected);
+parserParses = function(input, expected) {
+ parses(PEG.parser, input, expected);
};
-global.parserDoesNotParse = function(input) {
- global.doesNotParse(PEG.parser, input);
-}
-
-global.parserDoesNotParseWithMessage = function(input, message) {
- global.doesNotParseWithMessage(PEG.parser, input, message);
-}
+parserDoesNotParse = function(input) {
+ doesNotParse(PEG.parser, input);
+};
-})(this);
+parserDoesNotParseWithMessage = function(input, message) {
+ doesNotParseWithMessage(PEG.parser, input, message);
+};

0 comments on commit cfc6041

Please sign in to comment.