Skip to content

Commit 417cfa5

Browse files
Check namespaces for strict mode.
1 parent ec9e461 commit 417cfa5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,8 @@ namespace ts {
748748
function updateStrictMode(node: Node) {
749749
switch (node.kind) {
750750
case SyntaxKind.SourceFile:
751-
updateStrictModeStatementList((<SourceFile>node).statements);
751+
case SyntaxKind.ModuleBlock:
752+
updateStrictModeStatementList((<SourceFile | ModuleBlock>node).statements);
752753
return;
753754
case SyntaxKind.Block:
754755
if (isFunctionLike(node.parent)) {
@@ -757,6 +758,7 @@ namespace ts {
757758
return;
758759
case SyntaxKind.ClassDeclaration:
759760
case SyntaxKind.ClassExpression:
761+
// All classes are automatically in strict mode in ES6.
760762
inStrictMode = true;
761763
return;
762764
}

0 commit comments

Comments
 (0)