Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9632c99

Browse files
committed
move static field from Lexer to hidden namespace
1 parent 5ddd8d9 commit 9632c99

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Parser.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Lexer(text, parsStrings){
66
this.index = 0;
77
}
88

9-
Lexer.OPERATORS = {
9+
OPERATORS = {
1010
'null':function(self){return _null;},
1111
'true':function(self){return true;},
1212
'false':function(self){return false;},
@@ -31,7 +31,7 @@ Lexer.OPERATORS = {
3131
'|':function(self, a,b){return b(self, a);},
3232
'!':function(self, a){return !a;}
3333
};
34-
Lexer.ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
34+
ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
3535

3636
Lexer.prototype = {
3737
peek: function() {
@@ -44,7 +44,6 @@ Lexer.prototype = {
4444

4545
parse: function() {
4646
var tokens = this.tokens;
47-
var OPERATORS = Lexer.OPERATORS;
4847
var canStartRegExp = true;
4948
while (this.index < this.text.length) {
5049
var ch = this.text.charAt(this.index);
@@ -149,7 +148,7 @@ Lexer.prototype = {
149148
}
150149
this.index++;
151150
}
152-
var fn = Lexer.OPERATORS[ident];
151+
var fn = OPERATORS[ident];
153152
if (!fn) {
154153
fn = getterFn(ident);
155154
fn.isAssignable = ident;
@@ -173,7 +172,7 @@ Lexer.prototype = {
173172
this.index += 4;
174173
string += String.fromCharCode(parseInt(hex, 16));
175174
} else {
176-
var rep = Lexer.ESCAPE[ch];
175+
var rep = ESCAPE[ch];
177176
if (rep) {
178177
string += rep;
179178
} else {

0 commit comments

Comments
 (0)