We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec9e461 commit 417cfa5Copy full SHA for 417cfa5
src/compiler/binder.ts
@@ -748,7 +748,8 @@ namespace ts {
748
function updateStrictMode(node: Node) {
749
switch (node.kind) {
750
case SyntaxKind.SourceFile:
751
- updateStrictModeStatementList((<SourceFile>node).statements);
+ case SyntaxKind.ModuleBlock:
752
+ updateStrictModeStatementList((<SourceFile | ModuleBlock>node).statements);
753
return;
754
case SyntaxKind.Block:
755
if (isFunctionLike(node.parent)) {
@@ -757,6 +758,7 @@ namespace ts {
757
758
759
case SyntaxKind.ClassDeclaration:
760
case SyntaxKind.ClassExpression:
761
+ // All classes are automatically in strict mode in ES6.
762
inStrictMode = true;
763
764
}
0 commit comments