From 417cfa5c2cdf1440033ae307527e62c49024ed06 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Mon, 15 Jun 2015 17:48:15 -0700 Subject: [PATCH] Check namespaces for strict mode. --- src/compiler/binder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9fee2b6f64d..2f4c2194371 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -748,7 +748,8 @@ namespace ts { function updateStrictMode(node: Node) { switch (node.kind) { case SyntaxKind.SourceFile: - updateStrictModeStatementList((node).statements); + case SyntaxKind.ModuleBlock: + updateStrictModeStatementList((node).statements); return; case SyntaxKind.Block: if (isFunctionLike(node.parent)) { @@ -757,6 +758,7 @@ namespace ts { return; case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: + // All classes are automatically in strict mode in ES6. inStrictMode = true; return; }