1
0
Fork 0
forked from 0x2620/oxjs

misc updates to ox.js

This commit is contained in:
rolux 2012-01-04 13:12:48 +05:30
commit 2ef642fdeb
11 changed files with 136 additions and 93 deletions

View file

@ -722,8 +722,9 @@ Ox.tokenize = (function() {
// scan back to the previous significant token,
// or the beginning of the source
while (
typeof tokens[--index] != 'undefined'
&& ['comment', 'linebreak', 'whitespace'].indexOf(tokens[index].type) > -1
tokens[--index] !== void 0 && [
'comment', 'linebreak', 'whitespace'
].indexOf(tokens[index].type) > -1
) {
offset += tokens[index].length;
}
@ -732,7 +733,9 @@ Ox.tokenize = (function() {
isRegExp = true;
} else {
prevToken = tokens[index];
prevString = source.substr(cursor - prevToken.length - offset, prevToken.length);
prevString = source.substr(
cursor - prevToken.length - offset, prevToken.length
);
isRegExp = (
prevToken.type == 'keyword'
&& ['false', 'null', 'true'].indexOf(prevString) == -1