Skip to content

Commit 2f597d5

Browse files
committed
Use equality
1 parent a01ac5f commit 2f597d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/scanner.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1803,8 +1803,8 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean
18031803
const stop = Math.min(text.length, 256);
18041804
while (i < stop) {
18051805
const ch = codePointAt(text, i);
1806-
if (!ch || ch === CharacterCodes.replacementCharacter) {
1807-
// Jump to the end of the file and fail.
1806+
// Jump to the end of the file and fail.
1807+
if (ch === CharacterCodes.nullCharacter || ch === CharacterCodes.replacementCharacter) {
18081808
error(Diagnostics.File_appears_to_be_binary);
18091809
pos = end;
18101810
return token = SyntaxKind.NonTextFileMarkerTrivia;

0 commit comments

Comments
 (0)