HTML: Convert more throw new Error() statements to assertions
This commit is contained in:
parent
be84284020
commit
49071c7d58
1 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ export class Highlighter {
|
|||
this.createNode({ position: { line: 0, character: 0 }, color: Palette.Plain, content: '' });
|
||||
this.reconsumeIn(State.Plain);
|
||||
break;
|
||||
default: VERIFY_NOT_REACHED();
|
||||
default: VERIFY_NOT_REACHED(this.currentToken.type);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -113,7 +113,7 @@ export class Highlighter {
|
|||
case Type.EndTag:
|
||||
this.emitNode({ position: { line: 0, character: 0 }, color: Palette.Punctuator, content: '>' });
|
||||
break;
|
||||
default: throw new Error('AfterAttributes got ' + JSON.stringify(this.currentToken));
|
||||
default: VERIFY_NOT_REACHED(this.currentToken.type);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -124,7 +124,7 @@ export class Highlighter {
|
|||
this.createNode({ position: { line: 0, character: 0 }, color: Palette.String, content: '' });
|
||||
this.reconsumeIn(State.Script);
|
||||
break;
|
||||
default: throw new Error('BeforeScript')
|
||||
default: VERIFY_NOT_REACHED(this.currentToken.type);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue