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) {
|
parses = function(parser, input, expected) {
|
||||||
|
|
||||||
global.parses = function(parser, input, expected) {
|
|
||||||
deepEqual(parser.parse(input), expected);
|
deepEqual(parser.parse(input), expected);
|
||||||
};
|
};
|
||||||
|
|
||||||
global.doesNotParse = function(parser, input) {
|
doesNotParse = function(parser, input) {
|
||||||
raises(function() { parser.parse(input); }, parser.SyntaxError);
|
raises(function() { parser.parse(input); }, parser.SyntaxError);
|
||||||
};
|
};
|
||||||
|
|
||||||
global.doesNotParseWithMessage = function(parser, input, message) {
|
doesNotParseWithMessage = function(parser, input, message) {
|
||||||
raises(
|
raises(
|
||||||
function() { parser.parse(input); },
|
function() { parser.parse(input); },
|
||||||
function(e) {
|
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(
|
raises(
|
||||||
function() { parser.parse(input); },
|
function() { parser.parse(input); },
|
||||||
function(e) {
|
function(e) {
|
||||||
|
@ -28,16 +26,14 @@ global.doesNotParseWithPos = function(parser, input, line, column) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
global.parserParses = function(input, expected) {
|
parserParses = function(input, expected) {
|
||||||
global.parses(PEG.parser, input, expected);
|
parses(PEG.parser, input, expected);
|
||||||
};
|
};
|
||||||
|
|
||||||
global.parserDoesNotParse = function(input) {
|
parserDoesNotParse = function(input) {
|
||||||
global.doesNotParse(PEG.parser, input);
|
doesNotParse(PEG.parser, input);
|
||||||
}
|
};
|
||||||
|
|
||||||
global.parserDoesNotParseWithMessage = function(input, message) {
|
parserDoesNotParseWithMessage = function(input, message) {
|
||||||
global.doesNotParseWithMessage(PEG.parser, input, message);
|
doesNotParseWithMessage(PEG.parser, input, message);
|
||||||
}
|
};
|
||||||
|
|
||||||
})(this);
|
|
||||||
|
|
Loading…
Reference in a new issue