avancement planning
This commit is contained in:
+3
-1
@@ -459,7 +459,9 @@ export class Tokenizer {
|
||||
: cp === $.NULL
|
||||
? TokenType.NULL_CHARACTER
|
||||
: TokenType.CHARACTER;
|
||||
this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp));
|
||||
// OPTIMIZATION: Use String.fromCharCode for BMP characters (< 0x10000) which is faster
|
||||
// than String.fromCodePoint. Characters outside BMP are rare in HTML.
|
||||
this._appendCharToCurrentCharacterToken(type, cp < 65536 ? String.fromCharCode(cp) : String.fromCodePoint(cp));
|
||||
}
|
||||
//NOTE: used when we emit characters explicitly.
|
||||
//This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
|
||||
|
||||
Reference in New Issue
Block a user