Skip to content

Commit c46309d

Browse files
committed
Updated baselines
1 parent 7610048 commit c46309d

49 files changed

Lines changed: 615 additions & 776 deletions

File tree

Some content is hidden

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

tests/baselines/reference/classExpressionWithDecorator1.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ var v = @decorate class C { static p = 1 };
33

44
//// [classExpressionWithDecorator1.js]
55
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
7-
switch (arguments.length) {
8-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
9-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
10-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
11-
}
6+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9+
return c > 3 && r && Object.defineProperty(target, key, r), r;
1210
};
1311
var v = ;
1412
var C = (function () {

tests/baselines/reference/decoratedClassFromExternalModule.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ import Decorated from 'decorated';
1111

1212
//// [decorated.js]
1313
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
15-
switch (arguments.length) {
16-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
17-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
18-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
19-
}
14+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17+
return c > 3 && r && Object.defineProperty(target, key, r), r;
2018
};
2119
function decorate(target) { }
2220
let Decorated = class {

tests/baselines/reference/decoratorChecksFunctionBodies.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ class A {
1717

1818
//// [decoratorChecksFunctionBodies.js]
1919
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
20-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
21-
switch (arguments.length) {
22-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
23-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
24-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
25-
}
20+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
21+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
22+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23+
return c > 3 && r && Object.defineProperty(target, key, r), r;
2624
};
2725
// from #2971
2826
function func(s) {
@@ -32,13 +30,12 @@ var A = (function () {
3230
}
3331
A.prototype.m = function () {
3432
};
35-
Object.defineProperty(A.prototype, "m",
36-
__decorate([
37-
(function (x, p) {
38-
var a = 3;
39-
func(a);
40-
return x;
41-
})
42-
], A.prototype, "m", Object.getOwnPropertyDescriptor(A.prototype, "m")));
33+
__decorate([
34+
(function (x, p) {
35+
var a = 3;
36+
func(a);
37+
return x;
38+
})
39+
], A.prototype, "m", null);
4340
return A;
4441
})();

tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ class Wat {
2626
exports.test = 'abc';
2727
//// [b.js]
2828
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
29-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
30-
switch (arguments.length) {
31-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
32-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
33-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
34-
}
29+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
30+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32+
return c > 3 && r && Object.defineProperty(target, key, r), r;
3533
};
3634
var a_1 = require('./a');
3735
function filter(handler) {
@@ -45,9 +43,8 @@ var Wat = (function () {
4543
Wat.whatever = function () {
4644
// ...
4745
};
48-
Object.defineProperty(Wat, "whatever",
49-
__decorate([
50-
filter(function () { return a_1.test == 'abc'; })
51-
], Wat, "whatever", Object.getOwnPropertyDescriptor(Wat, "whatever")));
46+
__decorate([
47+
filter(function () { return a_1.test == 'abc'; })
48+
], Wat, "whatever", null);
5249
return Wat;
5350
})();

tests/baselines/reference/decoratorMetadata.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
2424
exports.default = Service;
2525
//// [component.js]
2626
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
27-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
28-
switch (arguments.length) {
29-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
30-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
31-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
32-
}
27+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30+
return c > 3 && r && Object.defineProperty(target, key, r), r;
3331
};
3432
var __metadata = (this && this.__metadata) || function (k, v) {
3533
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);

tests/baselines/reference/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ var MyClass = (function () {
2020
}
2121
MyClass.prototype.doSomething = function () {
2222
};
23-
Object.defineProperty(MyClass.prototype, "doSomething",
24-
__decorate([
25-
decorator,
26-
__metadata('design:type', Function),
27-
__metadata('design:paramtypes', []),
28-
__metadata('design:returntype', void 0)
29-
], MyClass.prototype, "doSomething", Object.getOwnPropertyDescriptor(MyClass.prototype, "doSomething")));
23+
__decorate([
24+
decorator,
25+
__metadata('design:type', Function),
26+
__metadata('design:paramtypes', []),
27+
__metadata('design:returntype', void 0)
28+
], MyClass.prototype, "doSomething", null);
3029
return MyClass;
3130
})();

tests/baselines/reference/decoratorMetadataOnInferredType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var B = (function () {
3333
__decorate([
3434
decorator,
3535
__metadata('design:type', Object)
36-
], B.prototype, "x");
36+
], B.prototype, "x", void 0);
3737
return B;
3838
})();
3939
exports.B = B;

tests/baselines/reference/decoratorMetadataWithConstructorType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var B = (function () {
3333
__decorate([
3434
decorator,
3535
__metadata('design:type', A)
36-
], B.prototype, "x");
36+
], B.prototype, "x", void 0);
3737
return B;
3838
})();
3939
exports.B = B;

tests/baselines/reference/decoratorOnClass1.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ class C {
77

88
//// [decoratorOnClass1.js]
99
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
11-
switch (arguments.length) {
12-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
13-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
14-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
15-
}
10+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13+
return c > 3 && r && Object.defineProperty(target, key, r), r;
1614
};
1715
var C = (function () {
1816
function C() {

tests/baselines/reference/decoratorOnClass2.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ export class C {
77

88
//// [decoratorOnClass2.js]
99
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
11-
switch (arguments.length) {
12-
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
13-
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
14-
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
15-
}
10+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13+
return c > 3 && r && Object.defineProperty(target, key, r), r;
1614
};
1715
var C = (function () {
1816
function C() {

0 commit comments

Comments
 (0)