File tree 6 files changed +31
-6
lines changed
6 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -1553,7 +1553,7 @@ namespace ts {
1553
1553
const seen = createMap < ElementKind > ( ) ;
1554
1554
1555
1555
for ( const prop of node . properties ) {
1556
- if ( prop . name . kind !== SyntaxKind . Identifier ) {
1556
+ if ( prop . kind === SyntaxKind . SpreadAssignment || prop . name . kind !== SyntaxKind . Identifier ) {
1557
1557
continue ;
1558
1558
}
1559
1559
Original file line number Diff line number Diff line change @@ -19970,9 +19970,13 @@ namespace ts {
19970
19970
if (requestedExternalEmitHelpers & NodeFlags.HasClassExtends && languageVersion < ScriptTarget.ES2015) {
19971
19971
verifyHelperSymbol(exports, "__extends", SymbolFlags.Value);
19972
19972
}
19973
- if (requestedExternalEmitHelpers & NodeFlags.HasSpreadAttribute && compilerOptions.jsx !== JsxEmit.Preserve) {
19973
+ if (requestedExternalEmitHelpers & NodeFlags.HasSpreadAttribute &&
19974
+ (languageVersion < ScriptTarget.ESNext || compilerOptions.jsx === JsxEmit.React)) {
19974
19975
verifyHelperSymbol(exports, "__assign", SymbolFlags.Value);
19975
19976
}
19977
+ if (languageVersion < ScriptTarget.ESNext && requestedExternalEmitHelpers & NodeFlags.HasRestAttribute) {
19978
+ verifyHelperSymbol(exports, "__rest", SymbolFlags.Value);
19979
+ }
19976
19980
if (requestedExternalEmitHelpers & NodeFlags.HasDecorators) {
19977
19981
verifyHelperSymbol(exports, "__decorate", SymbolFlags.Value);
19978
19982
if (compilerOptions.emitDecoratorMetadata) {
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ namespace ts {
433
433
BlockScoped = Let | Const ,
434
434
435
435
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn ,
436
- EmitHelperFlags = HasClassExtends | HasDecorators | HasParamDecorators | HasAsyncFunctions | HasSpreadAttribute ,
436
+ EmitHelperFlags = HasClassExtends | HasDecorators | HasParamDecorators | HasAsyncFunctions | HasSpreadAttribute | HasRestAttribute ,
437
437
ReachabilityAndEmitFlags = ReachabilityCheckFlags | EmitHelperFlags ,
438
438
439
439
// Parsing context flags
Original file line number Diff line number Diff line change
1
+ error TS2305: Module 'tslib' has no exported member '__assign'.
1
2
error TS2305: Module 'tslib' has no exported member '__decorate'.
2
3
error TS2305: Module 'tslib' has no exported member '__extends'.
3
4
error TS2305: Module 'tslib' has no exported member '__metadata'.
4
5
error TS2305: Module 'tslib' has no exported member '__param'.
6
+ error TS2305: Module 'tslib' has no exported member '__rest'.
5
7
6
8
9
+ !!! error TS2305: Module 'tslib' has no exported member '__assign'.
7
10
!!! error TS2305: Module 'tslib' has no exported member '__decorate'.
8
11
!!! error TS2305: Module 'tslib' has no exported member '__extends'.
9
12
!!! error TS2305: Module 'tslib' has no exported member '__metadata'.
10
13
!!! error TS2305: Module 'tslib' has no exported member '__param'.
14
+ !!! error TS2305: Module 'tslib' has no exported member '__rest'.
11
15
==== tests/cases/compiler/external.ts (0 errors) ====
12
16
export class A { }
13
17
export class B extends A { }
@@ -20,6 +24,10 @@ error TS2305: Module 'tslib' has no exported member '__param'.
20
24
}
21
25
}
22
26
27
+ const o = { a: 1 };
28
+ const y = { ...o };
29
+ const { ...x } = y;
30
+
23
31
==== tests/cases/compiler/script.ts (0 errors) ====
24
32
class A { }
25
33
class B extends A { }
@@ -33,4 +41,5 @@ error TS2305: Module 'tslib' has no exported member '__param'.
33
41
}
34
42
35
43
==== tests/cases/compiler/tslib.d.ts (0 errors) ====
36
- export {}
44
+ export {}
45
+
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ class C {
11
11
method ( @dec x : number ) {
12
12
}
13
13
}
14
+
15
+ const o = { a : 1 } ;
16
+ const y = { ...o } ;
17
+ const { ...x } = y ;
14
18
15
19
//// [script.ts]
16
20
class A { }
@@ -25,7 +29,8 @@ class C {
25
29
}
26
30
27
31
//// [tslib.d.ts]
28
- export { }
32
+ export { }
33
+
29
34
30
35
//// [external.js]
31
36
"use strict" ;
@@ -61,6 +66,9 @@ C = tslib_1.__decorate([
61
66
dec ,
62
67
tslib_1 . __metadata ( "design:paramtypes" , [ ] )
63
68
] , C ) ;
69
+ var o = { a : 1 } ;
70
+ var y = __assign ( { } , o ) ;
71
+ var x = __rest ( y , [ ] ) ;
64
72
//// [script.js]
65
73
var __extends = ( this && this . __extends ) || function ( d , b ) {
66
74
for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class C {
16
16
}
17
17
}
18
18
19
+ const o = { a : 1 } ;
20
+ const y = { ...o } ;
21
+ const { ...x } = y ;
22
+
19
23
// @filename : script.ts
20
24
class A { }
21
25
class B extends A { }
@@ -29,4 +33,4 @@ class C {
29
33
}
30
34
31
35
// @filename : tslib.d.ts
32
- export { }
36
+ export { }
You can’t perform that action at this time.
0 commit comments