Simplify token context (#13450)
* refactor: unify tc.brace and tc.templateQuasi * refactor: remove unused context check * perf: reduce arrayPrototype call and hoist variables
This commit is contained in:
@@ -127,10 +127,10 @@ export default class State {
|
||||
lastTokStart: number = 0;
|
||||
lastTokEnd: number = 0;
|
||||
|
||||
// The context stack is used to superficially track syntactic
|
||||
// context to predict whether a regular expression is allowed in a
|
||||
// given position.
|
||||
// The context stack is used to track whether the apostrophe "`" starts
|
||||
// or ends a string template
|
||||
context: Array<TokContext> = [ct.brace];
|
||||
// Used to track whether a JSX element is allowed to form
|
||||
exprAllowed: boolean = true;
|
||||
|
||||
// Used to signal to callers of `readWord1` whether the word
|
||||
|
||||
Reference in New Issue
Block a user