Skip to content

Commit fad8892

Browse files
committed
Merge branch 'master' into exportEqualsMerged
Conflicts: src/compiler/checker.ts src/compiler/emitter.ts src/compiler/types.ts tests/baselines/reference/APISample_compile.js tests/baselines/reference/APISample_linter.js tests/baselines/reference/APISample_transform.js tests/baselines/reference/APISample_watcher.js tests/baselines/reference/es5ExportDefaultClassDeclaration2.js tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.js tests/baselines/reference/es6ExportAllInEs5.js tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.js
2 parents 1c45b77 + a60d591 commit fad8892

File tree

432 files changed

+8574
-3792
lines changed

Some content is hidden

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

432 files changed

+8574
-3792
lines changed

src/compiler/checker.ts

Lines changed: 247 additions & 161 deletions
Large diffs are not rendered by default.

src/compiler/core.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,39 @@ module ts {
162162
return ~low;
163163
}
164164

165+
export function reduceLeft<T>(array: T[], f: (a: T, x: T) => T): T;
166+
export function reduceLeft<T, U>(array: T[], f: (a: U, x: T) => U, initial: U): U;
167+
export function reduceLeft<T, U>(array: T[], f: (a: U, x: T) => U, initial?: U): U {
168+
if (array) {
169+
var count = array.length;
170+
if (count > 0) {
171+
var pos = 0;
172+
var result = arguments.length <= 2 ? array[pos++] : initial;
173+
while (pos < count) {
174+
result = f(<U>result, array[pos++]);
175+
}
176+
return <U>result;
177+
}
178+
}
179+
return initial;
180+
}
181+
182+
export function reduceRight<T>(array: T[], f: (a: T, x: T) => T): T;
183+
export function reduceRight<T, U>(array: T[], f: (a: U, x: T) => U, initial: U): U;
184+
export function reduceRight<T, U>(array: T[], f: (a: U, x: T) => U, initial?: U): U {
185+
if (array) {
186+
var pos = array.length - 1;
187+
if (pos >= 0) {
188+
var result = arguments.length <= 2 ? array[pos--] : initial;
189+
while (pos >= 0) {
190+
result = f(<U>result, array[pos--]);
191+
}
192+
return <U>result;
193+
}
194+
}
195+
return initial;
196+
}
197+
165198
let hasOwnProperty = Object.prototype.hasOwnProperty;
166199

167200
export function hasProperty<T>(map: Map<T>, key: string): boolean {

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ module ts {
162162
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
163163
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
164164
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
165+
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
166+
Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." },
167+
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
165168
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
166169
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." },
167170
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },

src/compiler/diagnosticMessages.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,18 @@
639639
"category": "Error",
640640
"code": 1204
641641
},
642+
"Decorators are only available when targeting ECMAScript 5 and higher.": {
643+
"category": "Error",
644+
"code": 1205
645+
},
646+
"Decorators are not valid here.": {
647+
"category": "Error",
648+
"code": 1206
649+
},
650+
"Decorators cannot be applied to multiple get/set accessors of the same name.": {
651+
"category": "Error",
652+
"code": 1207
653+
},
642654

643655
"Duplicate identifier '{0}'.": {
644656
"category": "Error",

0 commit comments

Comments
 (0)