From 042e1bbd91f2fe535cd54df8c673c5577a136ed8 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 20 Aug 2015 17:45:54 +1000 Subject: [PATCH] fix(scanner) try a trivia scan only if pos === 0 --- src/compiler/scanner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 2f73c9c8820..199e7e9b638 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -472,7 +472,7 @@ namespace ts { break; case CharacterCodes.hash: - if (isShebangTrivia(text, pos)) { + if (pos === 0 && isShebangTrivia(text, pos)) { pos = scanShebangTrivia(text, pos); continue; }