Skip to content

Commit cc32e23

Browse files
Merge branch 'release-1.5' into sourceMapWithComments-attempt2
2 parents 2d09dcc + 70241fd commit cc32e23

Some content is hidden

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

45 files changed

+294
-253
lines changed

bin/tsc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20158,8 +20158,8 @@ var ts;
2015820158
ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile;
2015920159
function emitFiles(resolver, host, targetSourceFile) {
2016020160
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
20161-
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
20162-
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
20161+
var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
20162+
var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
2016320163
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
2016420164
var compilerOptions = host.getCompilerOptions();
2016520165
var languageVersion = compilerOptions.target || 0;

bin/tsserver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20508,8 +20508,8 @@ var ts;
2050820508
ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile;
2050920509
function emitFiles(resolver, host, targetSourceFile) {
2051020510
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
20511-
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
20512-
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
20511+
var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
20512+
var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
2051320513
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
2051420514
var compilerOptions = host.getCompilerOptions();
2051520515
var languageVersion = compilerOptions.target || 0;

bin/typescript.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24027,9 +24027,9 @@ var ts;
2402724027
// emit output for the __extends helper function
2402824028
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
2402924029
// emit output for the __decorate helper function
24030-
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
24030+
var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
2403124031
// emit output for the __metadata helper function
24032-
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
24032+
var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
2403324033
// emit output for the __param helper function
2403424034
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
2403524035
var compilerOptions = host.getCompilerOptions();
@@ -41172,4 +41172,4 @@ var TypeScript;
4117241172
})(Services = TypeScript.Services || (TypeScript.Services = {}));
4117341173
})(TypeScript || (TypeScript = {}));
4117441174
/* @internal */
41175-
var toolsVersion = "1.4";
41175+
var toolsVersion = "1.5";

bin/typescriptServices.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24027,9 +24027,9 @@ var ts;
2402724027
// emit output for the __extends helper function
2402824028
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
2402924029
// emit output for the __decorate helper function
24030-
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
24030+
var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
2403124031
// emit output for the __metadata helper function
24032-
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
24032+
var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
2403324033
// emit output for the __param helper function
2403424034
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
2403524035
var compilerOptions = host.getCompilerOptions();
@@ -41172,4 +41172,4 @@ var TypeScript;
4117241172
})(Services = TypeScript.Services || (TypeScript.Services = {}));
4117341173
})(TypeScript || (TypeScript = {}));
4117441174
/* @internal */
41175-
var toolsVersion = "1.4";
41175+
var toolsVersion = "1.5";

src/compiler/emitter.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ var __extends = this.__extends || function (d, b) {
2323

2424
// emit output for the __decorate helper function
2525
const decorateHelper = `
26-
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
26+
var __decorate = this.__decorate || function (decorators, target, key, desc) {
27+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
2728
switch (arguments.length) {
2829
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
2930
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
@@ -33,7 +34,9 @@ var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.deco
3334

3435
// emit output for the __metadata helper function
3536
const metadataHelper = `
36-
var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };`;
37+
var __metadata = this.__metadata || function (k, v) {
38+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
39+
};`;
3740

3841
// emit output for the __param helper function
3942
const paramHelper = `

src/services/shims.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,4 +869,4 @@ module TypeScript.Services {
869869
}
870870

871871
/* @internal */
872-
let toolsVersion = "1.4";
872+
const toolsVersion = "1.5";

tests/baselines/reference/classExpressionWithDecorator1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
var v = @decorate class C { static p = 1 };
33

44
//// [classExpressionWithDecorator1.js]
5-
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
5+
var __decorate = this.__decorate || function (decorators, target, key, desc) {
6+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
67
switch (arguments.length) {
78
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
89
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);

tests/baselines/reference/decoratedClassFromExternalModule.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export default class Decorated { }
1010
import Decorated from 'decorated';
1111

1212
//// [decorated.js]
13-
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
13+
var __decorate = this.__decorate || function (decorators, target, key, desc) {
14+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
1415
switch (arguments.length) {
1516
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
1617
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);

tests/baselines/reference/decoratorOnClass1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class C {
66
}
77

88
//// [decoratorOnClass1.js]
9-
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
9+
var __decorate = this.__decorate || function (decorators, target, key, desc) {
10+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
1011
switch (arguments.length) {
1112
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
1213
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);

tests/baselines/reference/decoratorOnClass2.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export class C {
66
}
77

88
//// [decoratorOnClass2.js]
9-
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
9+
var __decorate = this.__decorate || function (decorators, target, key, desc) {
10+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
1011
switch (arguments.length) {
1112
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
1213
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);

0 commit comments

Comments
 (0)