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 {