Skip to content

Commit 1bab233

Browse files
committed
Updated baselines
1 parent 1a18133 commit 1bab233

5 files changed

+43
-60
lines changed

tests/baselines/reference/classExpressionWithDecorator1.js

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

44
//// [classExpressionWithDecorator1.js]
5-
var __decorate = this.__decorate || function (decorators, target, key, value) {
6-
var kind = typeof (arguments.length == 2 ? value = target : value);
7-
for (var i = decorators.length - 1; i >= 0; --i) {
8-
var decorator = decorators[i];
9-
switch (kind) {
10-
case "function": value = decorator(value) || value; break;
11-
case "number": decorator(target, key, value); break;
12-
case "undefined": decorator(target, key); break;
13-
case "object": value = decorator(target, key, value) || value; break;
14-
}
5+
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
6+
switch (arguments.length) {
7+
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
8+
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
9+
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
1510
}
16-
return value;
1711
};
1812
var v = ;
1913
var C = (function () {
2014
function C() {
2115
}
2216
C.p = 1;
23-
C = __decorate([decorate], C);
17+
C = __decorate([
18+
decorate
19+
], C);
2420
return C;
2521
})();
2622
;

tests/baselines/reference/decoratorOnClassAccessor3.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ class C {
66
}
77

88
//// [decoratorOnClassAccessor3.js]
9-
var __decorate = this.__decorate || function (decorators, target, key, value) {
10-
var kind = typeof (arguments.length == 2 ? value = target : value);
11-
for (var i = decorators.length - 1; i >= 0; --i) {
12-
var decorator = decorators[i];
13-
switch (kind) {
14-
case "function": value = decorator(value) || value; break;
15-
case "number": decorator(target, key, value); break;
16-
case "undefined": decorator(target, key); break;
17-
case "object": value = decorator(target, key, value) || value; break;
18-
}
9+
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
10+
switch (arguments.length) {
11+
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
12+
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
13+
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
1914
}
20-
return value;
2115
};
2216
var C = (function () {
2317
function C() {
@@ -27,6 +21,9 @@ var C = (function () {
2721
enumerable: true,
2822
configurable: true
2923
});
30-
Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
24+
Object.defineProperty(C.prototype, "accessor",
25+
__decorate([
26+
dec
27+
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
3128
return C;
3229
})();

tests/baselines/reference/decoratorOnClassAccessor6.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ class C {
66
}
77

88
//// [decoratorOnClassAccessor6.js]
9-
var __decorate = this.__decorate || function (decorators, target, key, value) {
10-
var kind = typeof (arguments.length == 2 ? value = target : value);
11-
for (var i = decorators.length - 1; i >= 0; --i) {
12-
var decorator = decorators[i];
13-
switch (kind) {
14-
case "function": value = decorator(value) || value; break;
15-
case "number": decorator(target, key, value); break;
16-
case "undefined": decorator(target, key); break;
17-
case "object": value = decorator(target, key, value) || value; break;
18-
}
9+
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
10+
switch (arguments.length) {
11+
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
12+
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
13+
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
1914
}
20-
return value;
2115
};
2216
var C = (function () {
2317
function C() {
@@ -27,6 +21,9 @@ var C = (function () {
2721
enumerable: true,
2822
configurable: true
2923
});
30-
Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
24+
Object.defineProperty(C.prototype, "accessor",
25+
__decorate([
26+
dec
27+
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
3128
return C;
3229
})();

tests/baselines/reference/decoratorOnClassMethod3.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,20 @@ class C {
66
}
77

88
//// [decoratorOnClassMethod3.js]
9-
var __decorate = this.__decorate || function (decorators, target, key, value) {
10-
var kind = typeof (arguments.length == 2 ? value = target : value);
11-
for (var i = decorators.length - 1; i >= 0; --i) {
12-
var decorator = decorators[i];
13-
switch (kind) {
14-
case "function": value = decorator(value) || value; break;
15-
case "number": decorator(target, key, value); break;
16-
case "undefined": decorator(target, key); break;
17-
case "object": value = decorator(target, key, value) || value; break;
18-
}
9+
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
10+
switch (arguments.length) {
11+
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
12+
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
13+
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
1914
}
20-
return value;
2115
};
2216
var C = (function () {
2317
function C() {
2418
}
2519
C.prototype.method = function () { };
26-
Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
20+
Object.defineProperty(C.prototype, "method",
21+
__decorate([
22+
dec
23+
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
2724
return C;
2825
})();

tests/baselines/reference/decoratorOnClassProperty3.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ class C {
66
}
77

88
//// [decoratorOnClassProperty3.js]
9-
var __decorate = this.__decorate || function (decorators, target, key, value) {
10-
var kind = typeof (arguments.length == 2 ? value = target : value);
11-
for (var i = decorators.length - 1; i >= 0; --i) {
12-
var decorator = decorators[i];
13-
switch (kind) {
14-
case "function": value = decorator(value) || value; break;
15-
case "number": decorator(target, key, value); break;
16-
case "undefined": decorator(target, key); break;
17-
case "object": value = decorator(target, key, value) || value; break;
18-
}
9+
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
10+
switch (arguments.length) {
11+
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
12+
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
13+
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
1914
}
20-
return value;
2115
};
2216
var C = (function () {
2317
function C() {
2418
}
25-
__decorate([dec], C.prototype, "prop");
19+
__decorate([
20+
dec
21+
], C.prototype, "prop");
2622
return C;
2723
})();

0 commit comments

Comments
 (0)