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; }