From 2abc7369554e5716e3c1a3e3e85cedb2138c0ce7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 7 Apr 2016 00:55:02 -0700 Subject: [PATCH] Ensure that the entire contents of the prologue are simply 'use strict'. --- src/compiler/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index f7aa18fa7ea..0fd423d342c 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -1204,7 +1204,7 @@ namespace ts { // Utilities function isUseStrictPrologue(node: ExpressionStatement): boolean { - return !!(node.expression as StringLiteral).text.match(/use strict/); + return (node.expression as StringLiteral).text === "use strict"; } export function addPrologueDirectives(target: Statement[], source: Statement[], ensureUseStrict?: boolean): number {