Skip to content

Commit 2c57776

Browse files
committed
Merge branch 'master' into extendsExpressions
Conflicts: src/compiler/checker.ts tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt
2 parents 38e3d9f + 718dc5b commit 2c57776

File tree

135 files changed

+1962
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1962
-1101
lines changed

Jakefile.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,9 @@ function cleanTestDirs() {
505505
}
506506

507507
// used to pass data from jake command line directly to run.js
508-
function writeTestConfigFile(tests, testConfigFile) {
508+
function writeTestConfigFile(tests, light, testConfigFile) {
509509
console.log('Running test(s): ' + tests);
510-
var testConfigContents = JSON.stringify({ test: [tests]});
510+
var testConfigContents = JSON.stringify({ test: [tests], light: light });
511511
fs.writeFileSync('test.config', testConfigContents);
512512
}
513513

@@ -523,13 +523,14 @@ task("runtests", ["tests", builtLocalDirectory], function() {
523523
cleanTestDirs();
524524
host = "mocha"
525525
tests = process.env.test || process.env.tests || process.env.t;
526+
var light = process.env.light || false;
526527
var testConfigFile = 'test.config';
527528
if(fs.existsSync(testConfigFile)) {
528529
fs.unlinkSync(testConfigFile);
529530
}
530531

531-
if(tests) {
532-
writeTestConfigFile(tests, testConfigFile);
532+
if(tests || light) {
533+
writeTestConfigFile(tests, light, testConfigFile);
533534
}
534535

535536
if (tests && tests.toLocaleLowerCase() === "rwc") {
@@ -572,12 +573,13 @@ task("runtests-browser", ["tests", "browserify", builtLocalDirectory], function(
572573
port = process.env.port || process.env.p || '8888';
573574
browser = process.env.browser || process.env.b || "IE";
574575
tests = process.env.test || process.env.tests || process.env.t;
576+
var light = process.env.light || false;
575577
var testConfigFile = 'test.config';
576578
if(fs.existsSync(testConfigFile)) {
577579
fs.unlinkSync(testConfigFile);
578580
}
579-
if(tests) {
580-
writeTestConfigFile(tests, testConfigFile);
581+
if(tests || light) {
582+
writeTestConfigFile(tests, light, testConfigFile);
581583
}
582584

583585
tests = tests ? tests : '';

scripts/processDiagnosticMessages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
5555
'// <auto-generated />\r\n' +
5656
'/// <reference path="types.ts" />\r\n' +
5757
'/* @internal */\r\n' +
58-
'module ts {\r\n' +
58+
'namespace ts {\r\n' +
5959
' export var Diagnostics = {\r\n';
6060
var names = Utilities.getObjectKeys(messageTable);
6161
for (var i = 0; i < names.length; i++) {

src/compiler/binder.ts

+279-4
Large diffs are not rendered by default.

src/compiler/checker.ts

+109-323
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <reference path="core.ts"/>
44
/// <reference path="scanner.ts"/>
55

6-
module ts {
6+
namespace ts {
77
/* @internal */
88
export var optionDeclarations: CommandLineOption[] = [
99
{

src/compiler/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="types.ts"/>
22

33
/* @internal */
4-
module ts {
4+
namespace ts {
55
// Ternary values are defined such that
66
// x & y is False if either x or y is False.
77
// x & y is Maybe if either x or y is Maybe, but neither x or y is False.

src/compiler/declarationEmitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="checker.ts"/>
22

33
/* @internal */
4-
module ts {
4+
namespace ts {
55
interface ModuleElementDeclarationEmitInfo {
66
node: Node;
77
outputPos: number;

src/compiler/diagnosticInformationMap.generated.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// <auto-generated />
22
/// <reference path="types.ts" />
33
/* @internal */
4-
module ts {
4+
namespace ts {
55
export var Diagnostics = {
66
Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." },
77
Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." },
@@ -171,8 +171,8 @@ module ts {
171171
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
172172
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
173173
Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
174-
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
175-
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
174+
Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: { code: 1214, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode." },
175+
Invalid_use_of_0_Modules_are_automatically_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Invalid use of '{0}'. Modules are automatically in strict mode." },
176176
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
177177
Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning: { code: 1219, category: DiagnosticCategory.Error, key: "Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning." },
178178
Generators_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 1220, category: DiagnosticCategory.Error, key: "Generators are only available when targeting ECMAScript 6 or higher." },
@@ -186,6 +186,11 @@ module ts {
186186
A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: DiagnosticCategory.Error, key: "A type predicate is only allowed in return type position for functions and methods." },
187187
A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: DiagnosticCategory.Error, key: "A type predicate cannot reference a rest parameter." },
188188
A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: DiagnosticCategory.Error, key: "A type predicate cannot reference element '{0}' in a binding pattern." },
189+
An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: DiagnosticCategory.Error, key: "An export assignment can only be used in a module." },
190+
An_import_declaration_can_only_be_used_in_a_namespace_or_module: { code: 1232, category: DiagnosticCategory.Error, key: "An import declaration can only be used in a namespace or module." },
191+
An_export_declaration_can_only_be_used_in_a_module: { code: 1233, category: DiagnosticCategory.Error, key: "An export declaration can only be used in a module." },
192+
An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: { code: 1234, category: DiagnosticCategory.Error, key: "An ambient module declaration is only allowed at the top level in a file." },
193+
A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: { code: 1235, category: DiagnosticCategory.Error, key: "A namespace declaration is only allowed in a namespace or module." },
189194
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
190195
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
191196
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },

src/compiler/diagnosticMessages.json

+24-4
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,13 @@
671671
"category": "Error",
672672
"code": 1213
673673
},
674-
"Type expected. '{0}' is a reserved word in strict mode": {
674+
"Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode.": {
675675
"category": "Error",
676-
"code": 1215
676+
"code": 1214
677677
},
678-
"Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode.": {
678+
"Invalid use of '{0}'. Modules are automatically in strict mode.": {
679679
"category": "Error",
680-
"code": 1216
680+
"code": 1215
681681
},
682682
"Export assignment is not supported when '--module' flag is 'system'.": {
683683
"category": "Error",
@@ -731,6 +731,26 @@
731731
"category": "Error",
732732
"code": 1230
733733
},
734+
"An export assignment can only be used in a module.": {
735+
"category": "Error",
736+
"code": 1231
737+
},
738+
"An import declaration can only be used in a namespace or module.": {
739+
"category": "Error",
740+
"code": 1232
741+
},
742+
"An export declaration can only be used in a module.": {
743+
"category": "Error",
744+
"code": 1233
745+
},
746+
"An ambient module declaration is only allowed at the top level in a file.": {
747+
"category": "Error",
748+
"code": 1234
749+
},
750+
"A namespace declaration is only allowed in a namespace or module.": {
751+
"category": "Error",
752+
"code": 1235
753+
},
734754

735755

736756
"Duplicate identifier '{0}'.": {

src/compiler/emitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// <reference path="declarationEmitter.ts"/>
33

44
/* @internal */
5-
module ts {
5+
namespace ts {
66
export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) {
77
return isExternalModule(sourceFile) || isDeclarationFile(sourceFile);
88
}

0 commit comments

Comments
 (0)