forked from 0x2620/oxjs
misc updates to ox.js
This commit is contained in:
parent
d64e39c5b2
commit
2ef642fdeb
11 changed files with 136 additions and 93 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue