introduce functions (#3360)

`var f = function() {};` => `function f() {}`
This commit is contained in:
Alex Lam S.L
2019-04-15 22:23:11 +08:00
committed by GitHub
parent a57b069409
commit 5172ba5f2a
7 changed files with 268 additions and 46 deletions

View File

@@ -272,10 +272,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
function find_eol() {
var text = S.text;
for (var i = S.pos, n = S.text.length; i < n; ++i) {
var ch = text[i];
if (NEWLINE_CHARS[ch])
return i;
for (var i = S.pos; i < S.text.length; ++i) {
if (NEWLINE_CHARS[text[i]]) return i;
}
return -1;
}