Skip to content

Commit ba6e5a0

Browse files
committed
Test error for import helpers with no __rest
1 parent d6bf27d commit ba6e5a0

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

tests/baselines/reference/importHelpersNoHelpers.errors.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
error TS2305: Module 'tslib' has no exported member '__assign'.
12
error TS2305: Module 'tslib' has no exported member '__decorate'.
23
error TS2305: Module 'tslib' has no exported member '__extends'.
34
error TS2305: Module 'tslib' has no exported member '__metadata'.
45
error TS2305: Module 'tslib' has no exported member '__param'.
6+
error TS2305: Module 'tslib' has no exported member '__rest'.
57

68

9+
!!! error TS2305: Module 'tslib' has no exported member '__assign'.
710
!!! error TS2305: Module 'tslib' has no exported member '__decorate'.
811
!!! error TS2305: Module 'tslib' has no exported member '__extends'.
912
!!! error TS2305: Module 'tslib' has no exported member '__metadata'.
1013
!!! error TS2305: Module 'tslib' has no exported member '__param'.
14+
!!! error TS2305: Module 'tslib' has no exported member '__rest'.
1115
==== tests/cases/compiler/external.ts (0 errors) ====
1216
export class A { }
1317
export class B extends A { }
@@ -20,6 +24,10 @@ error TS2305: Module 'tslib' has no exported member '__param'.
2024
}
2125
}
2226

27+
const o = { a: 1 };
28+
const y = { ...o };
29+
const { ...x } = y;
30+
2331
==== tests/cases/compiler/script.ts (0 errors) ====
2432
class A { }
2533
class B extends A { }
@@ -33,4 +41,5 @@ error TS2305: Module 'tslib' has no exported member '__param'.
3341
}
3442

3543
==== tests/cases/compiler/tslib.d.ts (0 errors) ====
36-
export {}
44+
export {}
45+

tests/baselines/reference/importHelpersNoHelpers.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class C {
1111
method(@dec x: number) {
1212
}
1313
}
14+
15+
const o = { a: 1 };
16+
const y = { ...o };
17+
const { ...x } = y;
1418

1519
//// [script.ts]
1620
class A { }
@@ -25,7 +29,8 @@ class C {
2529
}
2630

2731
//// [tslib.d.ts]
28-
export {}
32+
export {}
33+
2934

3035
//// [external.js]
3136
"use strict";
@@ -61,6 +66,9 @@ C = tslib_1.__decorate([
6166
dec,
6267
tslib_1.__metadata("design:paramtypes", [])
6368
], C);
69+
var o = { a: 1 };
70+
var y = __assign({}, o);
71+
var x = __rest(y, []);
6472
//// [script.js]
6573
var __extends = (this && this.__extends) || function (d, b) {
6674
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];

tests/cases/compiler/importHelpersNoHelpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ class C {
1616
}
1717
}
1818

19+
const o = { a: 1 };
20+
const y = { ...o };
21+
const { ...x } = y;
22+
1923
// @filename: script.ts
2024
class A { }
2125
class B extends A { }
@@ -29,4 +33,4 @@ class C {
2933
}
3034

3135
// @filename: tslib.d.ts
32-
export {}
36+
export {}

0 commit comments

Comments
 (0)