@@ -11118,7 +11118,7 @@ module ts {
11118
11118
let contextErrorMessage = isAmbientExternalModule
11119
11119
? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file
11120
11120
: Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module;
11121
- if (! checkGrammarModuleElementContext(node, contextErrorMessage)) {
11121
+ if (checkGrammarModuleElementContext(node, contextErrorMessage)) {
11122
11122
return;
11123
11123
}
11124
11124
@@ -11234,7 +11234,7 @@ module ts {
11234
11234
}
11235
11235
11236
11236
function checkImportDeclaration(node: ImportDeclaration) {
11237
- if (! checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
11237
+ if (checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
11238
11238
return;
11239
11239
}
11240
11240
if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) {
@@ -11259,7 +11259,7 @@ module ts {
11259
11259
}
11260
11260
11261
11261
function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) {
11262
- if (! checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
11262
+ if (checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
11263
11263
return;
11264
11264
}
11265
11265
@@ -11294,7 +11294,7 @@ module ts {
11294
11294
}
11295
11295
11296
11296
function checkExportDeclaration(node: ExportDeclaration) {
11297
- if (! checkGrammarModuleElementContext(node, Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) {
11297
+ if (checkGrammarModuleElementContext(node, Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) {
11298
11298
return;
11299
11299
}
11300
11300
@@ -11325,11 +11325,8 @@ module ts {
11325
11325
11326
11326
function checkGrammarModuleElementContext(node: Statement, errorMessage: DiagnosticMessage): boolean {
11327
11327
if (node.parent.kind !== SyntaxKind.SourceFile && node.parent.kind !== SyntaxKind.ModuleBlock && node.parent.kind !== SyntaxKind.ModuleDeclaration) {
11328
- grammarErrorOnFirstToken(node, errorMessage);
11329
- return false;
11328
+ return grammarErrorOnFirstToken(node, errorMessage);
11330
11329
}
11331
-
11332
- return true;
11333
11330
}
11334
11331
11335
11332
function checkExportSpecifier(node: ExportSpecifier) {
@@ -11340,7 +11337,7 @@ module ts {
11340
11337
}
11341
11338
11342
11339
function checkExportAssignment(node: ExportAssignment) {
11343
- if (! checkGrammarModuleElementContext(node, Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
11340
+ if (checkGrammarModuleElementContext(node, Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
11344
11341
return;
11345
11342
}
11346
11343
0 commit comments