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.
This commit is contained in:
parent
f0eab4728a
commit
cfc6041041
|
@ -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);
|
||||
}
|
||||
parserDoesNotParse = function(input) {
|
||||
doesNotParse(PEG.parser, input);
|
||||
};
|
||||
|
||||
global.parserDoesNotParseWithMessage = function(input, message) {
|
||||
global.doesNotParseWithMessage(PEG.parser, input, message);
|
||||
}
|
||||
|
||||
})(this);
|
||||
parserDoesNotParseWithMessage = function(input, message) {
|
||||
doesNotParseWithMessage(PEG.parser, input, message);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue