-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7555 from Microsoft/destructuring-variable-declar…
…ations Destructuring in variable declarations when module kind is not ES6
- Loading branch information
Showing
33 changed files
with
375 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/destructuringInVariableDeclarations1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//// [destructuringInVariableDeclarations1.ts] | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
|
||
|
||
//// [destructuringInVariableDeclarations1.js] | ||
"use strict"; | ||
exports.toString = (1).toString; | ||
{ | ||
let { toFixed } = 1; | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/destructuringInVariableDeclarations1.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations1.ts === | ||
export let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations1.ts, 0, 12)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations1.ts, 2, 9)) | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/destructuringInVariableDeclarations1.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations1.ts === | ||
export let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/destructuringInVariableDeclarations2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//// [destructuringInVariableDeclarations2.ts] | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; | ||
|
||
|
||
//// [destructuringInVariableDeclarations2.js] | ||
"use strict"; | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/destructuringInVariableDeclarations2.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations2.ts === | ||
let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations2.ts, 0, 5)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations2.ts, 2, 9)) | ||
} | ||
export {}; | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/destructuringInVariableDeclarations2.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations2.ts === | ||
let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
export {}; | ||
|
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/destructuringInVariableDeclarations3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [destructuringInVariableDeclarations3.ts] | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
|
||
|
||
//// [destructuringInVariableDeclarations3.js] | ||
define(["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
exports.toString = (1).toString; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/destructuringInVariableDeclarations3.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations3.ts === | ||
export let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations3.ts, 0, 12)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations3.ts, 2, 9)) | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/destructuringInVariableDeclarations3.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations3.ts === | ||
export let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/destructuringInVariableDeclarations4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//// [destructuringInVariableDeclarations4.ts] | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; | ||
|
||
|
||
//// [destructuringInVariableDeclarations4.js] | ||
define(["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
}); |
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/destructuringInVariableDeclarations4.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations4.ts === | ||
let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations4.ts, 0, 5)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations4.ts, 2, 9)) | ||
} | ||
export {}; | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/destructuringInVariableDeclarations4.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations4.ts === | ||
let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
export {}; | ||
|
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/destructuringInVariableDeclarations5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//// [destructuringInVariableDeclarations5.ts] | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
|
||
|
||
//// [destructuringInVariableDeclarations5.js] | ||
(function (factory) { | ||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === 'function' && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
exports.toString = (1).toString; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/destructuringInVariableDeclarations5.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations5.ts === | ||
export let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations5.ts, 0, 12)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations5.ts, 2, 9)) | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/destructuringInVariableDeclarations5.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations5.ts === | ||
export let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/destructuringInVariableDeclarations6.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// [destructuringInVariableDeclarations6.ts] | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; | ||
|
||
|
||
//// [destructuringInVariableDeclarations6.js] | ||
(function (factory) { | ||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === 'function' && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
}); |
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/destructuringInVariableDeclarations6.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations6.ts === | ||
let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations6.ts, 0, 5)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations6.ts, 2, 9)) | ||
} | ||
export {}; | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/destructuringInVariableDeclarations6.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations6.ts === | ||
let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
export {}; | ||
|
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/destructuringInVariableDeclarations7.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//// [destructuringInVariableDeclarations7.ts] | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
|
||
|
||
//// [destructuringInVariableDeclarations7.js] | ||
System.register([], function(exports_1, context_1) { | ||
"use strict"; | ||
var __moduleName = context_1 && context_1.id; | ||
var toString; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
exports_1("toString", toString = (1).toString); | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
} | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/destructuringInVariableDeclarations7.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations7.ts === | ||
export let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations7.ts, 0, 12)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations7.ts, 2, 9)) | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/destructuringInVariableDeclarations7.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations7.ts === | ||
export let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/destructuringInVariableDeclarations8.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// [destructuringInVariableDeclarations8.ts] | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; | ||
|
||
|
||
//// [destructuringInVariableDeclarations8.js] | ||
System.register([], function(exports_1, context_1) { | ||
"use strict"; | ||
var __moduleName = context_1 && context_1.id; | ||
var toString; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
({ toString } = 1); | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
} | ||
} | ||
}); |
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/destructuringInVariableDeclarations8.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations8.ts === | ||
let { toString } = 1; | ||
>toString : Symbol(toString, Decl(destructuringInVariableDeclarations8.ts, 0, 5)) | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : Symbol(toFixed, Decl(destructuringInVariableDeclarations8.ts, 2, 9)) | ||
} | ||
export {}; | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/destructuringInVariableDeclarations8.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
=== tests/cases/compiler/destructuringInVariableDeclarations8.ts === | ||
let { toString } = 1; | ||
>toString : (radix?: number) => string | ||
>1 : number | ||
{ | ||
let { toFixed } = 1; | ||
>toFixed : (fractionDigits?: number) => string | ||
>1 : number | ||
} | ||
export {}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// @target: es6 | ||
// @module: commonjs | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @target: es6 | ||
// @module: commonjs | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// @target: es6 | ||
// @module: amd | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @target: es6 | ||
// @module: amd | ||
let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// @target: es6 | ||
// @module: umd | ||
export let { toString } = 1; | ||
{ | ||
let { toFixed } = 1; | ||
} |
Oops, something went wrong.