merge with master

This commit is contained in:
Vladimir Matveev
2015-10-27 10:50:18 -07:00
205 changed files with 78012 additions and 41181 deletions
+36 -11
View File
@@ -1,17 +1,21 @@
## Contributing bug fixes
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
## Contributing features
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue.
## Legal
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <cla@microsoft.com>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request.
## Housekeeping
Your pull request should:
* Include a description of what your change intends to do
@@ -29,7 +33,8 @@ Your pull request should:
* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration
## Running the Tests
To run all tests, invoke the runtests target using jake:
To run all tests, invoke the `runtests` target using jake:
```Shell
jake runtests
@@ -47,23 +52,42 @@ e.g. to run all compiler baseline tests:
jake runtests tests=compiler
```
or to run specifc test: `tests\cases\compiler\2dArrays.ts`
or to run a specific test: `tests\cases\compiler\2dArrays.ts`
```Shell
jake runtests tests=2dArrays
```
## Debugging the tests
To debug the tests, invoke the `runtests-browser` task from jake.
You will probably only want to debug one test at a time:
```Shell
jake runtests-browser tests=2dArrays
```
You can specify which browser to use for debugging. Currently Chrome and IE are supported:
```Shell
jake runtests-browser tests=2dArrays browser=chrome
```
You can debug with VS Code or Node instead with `jake runtests debug=true`:
```Shell
jake runtests tests=2dArrays debug=true
```
## Adding a Test
To add a new testcase, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
These files support metadata tags in the format `// @metaDataName: value`. The supported names and values are:
To add a new test case, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
* `comments`, `sourcemap`, `noimplicitany`, `declaration`: true or false (corresponds to the compiler command-line options of the same name)
* `target`: ES3 or ES5 (same as compiler)
* `out`, outDir: path (same as compiler)
* `module`: local, commonjs, or amd (local corresponds to not passing any compiler --module flag)
* `fileName`: path
* These tags delimit sections of a file to be used as separate compilation units. They are useful for tests relating to modules. See below for examples.
These files support metadata tags in the format `// @metaDataName: value`.
The supported names and values are the same as those supported in the compiler itself, with the addition of the `fileName` flag.
`fileName` tags delimit sections of a file to be used as separate compilation units.
They are useful for tests relating to modules.
See below for examples.
**Note** that if you have a test corresponding to a specific spec compliance item, you can place it in `tests\cases\conformance` in an appropriately-named subfolder.
**Note** that filenames here must be distinct from all other compiler testcase names, so you may have to work a bit to find a unique name if it's something common.
@@ -86,6 +110,7 @@ var x = g();
One can also write a project test, but it is slightly more involved.
## Managing the Baselines
Compiler testcases generate baselines that track the emitted `.js`, the errors produced by the compiler, and the type of each expression in the file. Additionally, some testcases opt in to baselining the source map output.
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
@@ -102,4 +127,4 @@ jake baseline-accept
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
**Note** that baseline-accept should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
**Note** that `baseline-accept` should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
+42 -15
View File
@@ -626,9 +626,7 @@ function deleteTemporaryProjectOutput() {
}
}
var testTimeout = 20000;
desc("Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]', debug=true.");
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
function runConsoleTests(defaultReporter, defaultSubsets, postLint) {
cleanTestDirs();
var debug = process.env.debug || process.env.d;
tests = process.env.test || process.env.tests || process.env.t;
@@ -638,7 +636,7 @@ task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
fs.unlinkSync(testConfigFile);
}
if(tests || light) {
if (tests || light) {
writeTestConfigFile(tests, light, testConfigFile);
}
@@ -648,20 +646,48 @@ task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
colors = process.env.colors || process.env.color
colors = colors ? ' --no-colors ' : ' --colors ';
tests = tests ? ' -g ' + tests : '';
reporter = process.env.reporter || process.env.r || 'mocha-fivemat-progress-reporter';
reporter = process.env.reporter || process.env.r || defaultReporter;
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
console.log(cmd);
exec(cmd, function() {
deleteTemporaryProjectOutput();
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
var subsetRegexes;
if(defaultSubsets.length === 0) {
subsetRegexes = [tests]
}
else {
var subsets = tests ? tests.split("|") : defaultSubsets;
subsetRegexes = subsets.map(function (sub) { return "^" + sub + ".*$"; });
subsetRegexes.push("^(?!" + subsets.join("|") + ").*$");
}
subsetRegexes.forEach(function (subsetRegex) {
tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '';
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
console.log(cmd);
exec(cmd, function () {
deleteTemporaryProjectOutput();
if (postLint) {
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
});
lint.invoke();
}
else {
complete();
}
});
lint.invoke();
});
}
var testTimeout = 20000;
desc("Runs all the tests in parallel using the built run.js file. Optional arguments are: t[ests]=category1|category2|... d[ebug]=true.");
task("runtests-parallel", ["build-rules", "tests", builtLocalDirectory], function() {
runConsoleTests('min', ['compiler', 'conformance', 'Projects', 'fourslash']);
}, {async: true});
desc("Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false.");
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
runConsoleTests('mocha-fivemat-progress-reporter', [], /*postLint*/ true);
}, {async: true});
desc("Generates code coverage data via instanbul");
@@ -820,7 +846,8 @@ var tslintRuleDir = "scripts/tslint";
var tslintRules = ([
"nextLineRule",
"noNullRule",
"booleanTriviaRule"
"booleanTriviaRule",
"typeOperatorSpacingRule"
]);
var tslintRulesFiles = tslintRules.map(function(p) {
return path.join(tslintRuleDir, p + ".ts");
+28 -1
View File
@@ -3965,7 +3965,34 @@ interface ObjectConstructor {
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects from which to copy properties
*/
assign(target: any, ...sources: any[]): any;
+27 -125
View File
@@ -4243,8 +4243,8 @@ interface AnalyserNode extends AudioNode {
smoothingTimeConstant: number;
getByteFrequencyData(array: Uint8Array): void;
getByteTimeDomainData(array: Uint8Array): void;
getFloatFrequencyData(array: any): void;
getFloatTimeDomainData(array: any): void;
getFloatFrequencyData(array: Float32Array): void;
getFloatTimeDomainData(array: Float32Array): void;
}
declare var AnalyserNode: {
@@ -4331,7 +4331,7 @@ interface AudioBuffer {
length: number;
numberOfChannels: number;
sampleRate: number;
getChannelData(channel: number): any;
getChannelData(channel: number): Float32Array;
}
declare var AudioBuffer: {
@@ -4375,7 +4375,7 @@ interface AudioContext extends EventTarget {
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
createOscillator(): OscillatorNode;
createPanner(): PannerNode;
createPeriodicWave(real: any, imag: any): PeriodicWave;
createPeriodicWave(real: Float32Array, imag: Float32Array): PeriodicWave;
createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
createStereoPanner(): StereoPannerNode;
createWaveShaper(): WaveShaperNode;
@@ -4433,7 +4433,7 @@ interface AudioParam {
linearRampToValueAtTime(value: number, endTime: number): void;
setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
setValueAtTime(value: number, startTime: number): void;
setValueCurveAtTime(values: any, startTime: number, duration: number): void;
setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
}
declare var AudioParam: {
@@ -4509,7 +4509,7 @@ interface BiquadFilterNode extends AudioNode {
frequency: AudioParam;
gain: AudioParam;
type: string;
getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void;
getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
}
declare var BiquadFilterNode: {
@@ -5108,7 +5108,7 @@ declare var CanvasPattern: {
interface CanvasRenderingContext2D {
canvas: HTMLCanvasElement;
fillStyle: any;
fillStyle: string | CanvasGradient | CanvasPattern;
font: string;
globalAlpha: number;
globalCompositeOperation: string;
@@ -5123,7 +5123,7 @@ interface CanvasRenderingContext2D {
shadowColor: string;
shadowOffsetX: number;
shadowOffsetY: number;
strokeStyle: any;
strokeStyle: string | CanvasGradient | CanvasPattern;
textAlign: string;
textBaseline: string;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
@@ -6491,8 +6491,6 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
importNode(importedNode: Node, deep: boolean): Node;
msElementsFromPoint(x: number, y: number): NodeList;
msElementsFromRect(left: number, top: number, width: number, height: number): NodeList;
msGetPrintDocumentForNamedFlow(flowName: string): Document;
msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void;
/**
* Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
* @param url Specifies a MIME type for the document.
@@ -11314,27 +11312,6 @@ declare var MSHTMLWebViewElement: {
new(): MSHTMLWebViewElement;
}
interface MSHeaderFooter {
URL: string;
dateLong: string;
dateShort: string;
font: string;
htmlFoot: string;
htmlHead: string;
page: number;
pageTotal: number;
textFoot: string;
textHead: string;
timeLong: string;
timeShort: string;
title: string;
}
declare var MSHeaderFooter: {
prototype: MSHeaderFooter;
new(): MSHeaderFooter;
}
interface MSInputMethodContext extends EventTarget {
compositionEndOffset: number;
compositionStartOffset: number;
@@ -11493,24 +11470,6 @@ declare var MSPointerEvent: {
new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;
}
interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget {
percentScale: number;
showHeaderFooter: boolean;
shrinkToFit: boolean;
drawPreviewPage(element: HTMLElement, pageNumber: number): void;
endPrint(): void;
getPrintTaskOptionValue(key: string): any;
invalidatePreview(): void;
setPageCount(pageCount: number): void;
startPrint(): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
declare var MSPrintManagerTemplatePrinter: {
prototype: MSPrintManagerTemplatePrinter;
new(): MSPrintManagerTemplatePrinter;
}
interface MSRangeCollection {
length: number;
item(index: number): Range;
@@ -11558,63 +11517,6 @@ declare var MSStreamReader: {
new(): MSStreamReader;
}
interface MSTemplatePrinter {
collate: boolean;
copies: number;
currentPage: boolean;
currentPageAvail: boolean;
duplex: boolean;
footer: string;
frameActive: boolean;
frameActiveEnabled: boolean;
frameAsShown: boolean;
framesetDocument: boolean;
header: string;
headerFooterFont: string;
marginBottom: number;
marginLeft: number;
marginRight: number;
marginTop: number;
orientation: string;
pageFrom: number;
pageHeight: number;
pageTo: number;
pageWidth: number;
selectedPages: boolean;
selection: boolean;
selectionEnabled: boolean;
unprintableBottom: number;
unprintableLeft: number;
unprintableRight: number;
unprintableTop: number;
usePrinterCopyCollate: boolean;
createHeaderFooter(): MSHeaderFooter;
deviceSupports(property: string): any;
ensurePrintDialogDefaults(): boolean;
getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginBottomImportant(pageRule: CSSPageRule): boolean;
getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginLeftImportant(pageRule: CSSPageRule): boolean;
getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginRightImportant(pageRule: CSSPageRule): boolean;
getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginTopImportant(pageRule: CSSPageRule): boolean;
printBlankPage(): void;
printNonNative(document: any): boolean;
printNonNativeFrames(document: any, activeFrame: boolean): void;
printPage(element: HTMLElement): void;
showPageSetupDialog(): boolean;
showPrintDialog(): boolean;
startDoc(title: string): boolean;
stopDoc(): void;
updatePageStatus(status: number): void;
}
declare var MSTemplatePrinter: {
prototype: MSTemplatePrinter;
new(): MSTemplatePrinter;
}
interface MSWebViewAsyncOperation extends EventTarget {
error: DOMError;
oncomplete: (ev: Event) => any;
@@ -12032,6 +11934,10 @@ declare var Node: {
}
interface NodeFilter {
acceptNode(n: Node): number;
}
declare var NodeFilter: {
FILTER_ACCEPT: number;
FILTER_REJECT: number;
FILTER_SKIP: number;
@@ -12049,7 +11955,6 @@ interface NodeFilter {
SHOW_PROCESSING_INSTRUCTION: number;
SHOW_TEXT: number;
}
declare var NodeFilter: NodeFilter;
interface NodeIterator {
expandEntityReferences: boolean;
@@ -12759,7 +12664,6 @@ declare var SVGDescElement: {
interface SVGElement extends Element {
id: string;
className: any;
onclick: (ev: MouseEvent) => any;
ondblclick: (ev: MouseEvent) => any;
onfocusin: (ev: FocusEvent) => any;
@@ -12773,6 +12677,7 @@ interface SVGElement extends Element {
ownerSVGElement: SVGSVGElement;
viewportElement: SVGElement;
xmlbase: string;
className: any;
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -14934,7 +14839,7 @@ declare var WEBGL_depth_texture: {
}
interface WaveShaperNode extends AudioNode {
curve: any;
curve: Float32Array;
oversample: string;
}
@@ -15121,34 +15026,34 @@ interface WebGLRenderingContext {
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
uniform1f(location: WebGLUniformLocation, x: number): void;
uniform1fv(location: WebGLUniformLocation, v: any): void;
uniform1fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform1i(location: WebGLUniformLocation, x: number): void;
uniform1iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform2f(location: WebGLUniformLocation, x: number, y: number): void;
uniform2fv(location: WebGLUniformLocation, v: any): void;
uniform2fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform2i(location: WebGLUniformLocation, x: number, y: number): void;
uniform2iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3fv(location: WebGLUniformLocation, v: any): void;
uniform3fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4fv(location: WebGLUniformLocation, v: any): void;
uniform4fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4iv(location: WebGLUniformLocation, v: Int32Array): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
useProgram(program: WebGLProgram): void;
validateProgram(program: WebGLProgram): void;
vertexAttrib1f(indx: number, x: number): void;
vertexAttrib1fv(indx: number, values: any): void;
vertexAttrib1fv(indx: number, values: Float32Array): void;
vertexAttrib2f(indx: number, x: number, y: number): void;
vertexAttrib2fv(indx: number, values: any): void;
vertexAttrib2fv(indx: number, values: Float32Array): void;
vertexAttrib3f(indx: number, x: number, y: number, z: number): void;
vertexAttrib3fv(indx: number, values: any): void;
vertexAttrib3fv(indx: number, values: Float32Array): void;
vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;
vertexAttrib4fv(indx: number, values: any): void;
vertexAttrib4fv(indx: number, values: Float32Array): void;
vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;
viewport(x: number, y: number, width: number, height: number): void;
ACTIVE_ATTRIBUTES: number;
@@ -15912,7 +15817,6 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
locationbar: BarProp;
menubar: BarProp;
msAnimationStartTime: number;
msTemplatePrinter: MSTemplatePrinter;
name: string;
navigator: Navigator;
offscreenBuffering: string | boolean;
@@ -16649,7 +16553,6 @@ interface XMLHttpRequestEventTarget {
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
@@ -16670,8 +16573,6 @@ interface EventListenerObject {
handleEvent(evt: Event): void;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface MessageEventInit extends EventInit {
data?: any;
origin?: string;
@@ -16687,6 +16588,8 @@ interface ProgressEventInit extends EventInit {
total?: number;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
(message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
}
@@ -16747,7 +16650,6 @@ declare var location: Location;
declare var locationbar: BarProp;
declare var menubar: BarProp;
declare var msAnimationStartTime: number;
declare var msTemplatePrinter: MSTemplatePrinter;
declare var name: string;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
+27 -125
View File
@@ -419,8 +419,8 @@ interface AnalyserNode extends AudioNode {
smoothingTimeConstant: number;
getByteFrequencyData(array: Uint8Array): void;
getByteTimeDomainData(array: Uint8Array): void;
getFloatFrequencyData(array: any): void;
getFloatTimeDomainData(array: any): void;
getFloatFrequencyData(array: Float32Array): void;
getFloatTimeDomainData(array: Float32Array): void;
}
declare var AnalyserNode: {
@@ -507,7 +507,7 @@ interface AudioBuffer {
length: number;
numberOfChannels: number;
sampleRate: number;
getChannelData(channel: number): any;
getChannelData(channel: number): Float32Array;
}
declare var AudioBuffer: {
@@ -551,7 +551,7 @@ interface AudioContext extends EventTarget {
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
createOscillator(): OscillatorNode;
createPanner(): PannerNode;
createPeriodicWave(real: any, imag: any): PeriodicWave;
createPeriodicWave(real: Float32Array, imag: Float32Array): PeriodicWave;
createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
createStereoPanner(): StereoPannerNode;
createWaveShaper(): WaveShaperNode;
@@ -609,7 +609,7 @@ interface AudioParam {
linearRampToValueAtTime(value: number, endTime: number): void;
setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
setValueAtTime(value: number, startTime: number): void;
setValueCurveAtTime(values: any, startTime: number, duration: number): void;
setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
}
declare var AudioParam: {
@@ -685,7 +685,7 @@ interface BiquadFilterNode extends AudioNode {
frequency: AudioParam;
gain: AudioParam;
type: string;
getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void;
getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
}
declare var BiquadFilterNode: {
@@ -1284,7 +1284,7 @@ declare var CanvasPattern: {
interface CanvasRenderingContext2D {
canvas: HTMLCanvasElement;
fillStyle: any;
fillStyle: string | CanvasGradient | CanvasPattern;
font: string;
globalAlpha: number;
globalCompositeOperation: string;
@@ -1299,7 +1299,7 @@ interface CanvasRenderingContext2D {
shadowColor: string;
shadowOffsetX: number;
shadowOffsetY: number;
strokeStyle: any;
strokeStyle: string | CanvasGradient | CanvasPattern;
textAlign: string;
textBaseline: string;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
@@ -2667,8 +2667,6 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
importNode(importedNode: Node, deep: boolean): Node;
msElementsFromPoint(x: number, y: number): NodeList;
msElementsFromRect(left: number, top: number, width: number, height: number): NodeList;
msGetPrintDocumentForNamedFlow(flowName: string): Document;
msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void;
/**
* Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
* @param url Specifies a MIME type for the document.
@@ -7490,27 +7488,6 @@ declare var MSHTMLWebViewElement: {
new(): MSHTMLWebViewElement;
}
interface MSHeaderFooter {
URL: string;
dateLong: string;
dateShort: string;
font: string;
htmlFoot: string;
htmlHead: string;
page: number;
pageTotal: number;
textFoot: string;
textHead: string;
timeLong: string;
timeShort: string;
title: string;
}
declare var MSHeaderFooter: {
prototype: MSHeaderFooter;
new(): MSHeaderFooter;
}
interface MSInputMethodContext extends EventTarget {
compositionEndOffset: number;
compositionStartOffset: number;
@@ -7669,24 +7646,6 @@ declare var MSPointerEvent: {
new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;
}
interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget {
percentScale: number;
showHeaderFooter: boolean;
shrinkToFit: boolean;
drawPreviewPage(element: HTMLElement, pageNumber: number): void;
endPrint(): void;
getPrintTaskOptionValue(key: string): any;
invalidatePreview(): void;
setPageCount(pageCount: number): void;
startPrint(): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
declare var MSPrintManagerTemplatePrinter: {
prototype: MSPrintManagerTemplatePrinter;
new(): MSPrintManagerTemplatePrinter;
}
interface MSRangeCollection {
length: number;
item(index: number): Range;
@@ -7734,63 +7693,6 @@ declare var MSStreamReader: {
new(): MSStreamReader;
}
interface MSTemplatePrinter {
collate: boolean;
copies: number;
currentPage: boolean;
currentPageAvail: boolean;
duplex: boolean;
footer: string;
frameActive: boolean;
frameActiveEnabled: boolean;
frameAsShown: boolean;
framesetDocument: boolean;
header: string;
headerFooterFont: string;
marginBottom: number;
marginLeft: number;
marginRight: number;
marginTop: number;
orientation: string;
pageFrom: number;
pageHeight: number;
pageTo: number;
pageWidth: number;
selectedPages: boolean;
selection: boolean;
selectionEnabled: boolean;
unprintableBottom: number;
unprintableLeft: number;
unprintableRight: number;
unprintableTop: number;
usePrinterCopyCollate: boolean;
createHeaderFooter(): MSHeaderFooter;
deviceSupports(property: string): any;
ensurePrintDialogDefaults(): boolean;
getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginBottomImportant(pageRule: CSSPageRule): boolean;
getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginLeftImportant(pageRule: CSSPageRule): boolean;
getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginRightImportant(pageRule: CSSPageRule): boolean;
getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginTopImportant(pageRule: CSSPageRule): boolean;
printBlankPage(): void;
printNonNative(document: any): boolean;
printNonNativeFrames(document: any, activeFrame: boolean): void;
printPage(element: HTMLElement): void;
showPageSetupDialog(): boolean;
showPrintDialog(): boolean;
startDoc(title: string): boolean;
stopDoc(): void;
updatePageStatus(status: number): void;
}
declare var MSTemplatePrinter: {
prototype: MSTemplatePrinter;
new(): MSTemplatePrinter;
}
interface MSWebViewAsyncOperation extends EventTarget {
error: DOMError;
oncomplete: (ev: Event) => any;
@@ -8208,6 +8110,10 @@ declare var Node: {
}
interface NodeFilter {
acceptNode(n: Node): number;
}
declare var NodeFilter: {
FILTER_ACCEPT: number;
FILTER_REJECT: number;
FILTER_SKIP: number;
@@ -8225,7 +8131,6 @@ interface NodeFilter {
SHOW_PROCESSING_INSTRUCTION: number;
SHOW_TEXT: number;
}
declare var NodeFilter: NodeFilter;
interface NodeIterator {
expandEntityReferences: boolean;
@@ -8935,7 +8840,6 @@ declare var SVGDescElement: {
interface SVGElement extends Element {
id: string;
className: any;
onclick: (ev: MouseEvent) => any;
ondblclick: (ev: MouseEvent) => any;
onfocusin: (ev: FocusEvent) => any;
@@ -8949,6 +8853,7 @@ interface SVGElement extends Element {
ownerSVGElement: SVGSVGElement;
viewportElement: SVGElement;
xmlbase: string;
className: any;
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -11110,7 +11015,7 @@ declare var WEBGL_depth_texture: {
}
interface WaveShaperNode extends AudioNode {
curve: any;
curve: Float32Array;
oversample: string;
}
@@ -11297,34 +11202,34 @@ interface WebGLRenderingContext {
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
uniform1f(location: WebGLUniformLocation, x: number): void;
uniform1fv(location: WebGLUniformLocation, v: any): void;
uniform1fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform1i(location: WebGLUniformLocation, x: number): void;
uniform1iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform2f(location: WebGLUniformLocation, x: number, y: number): void;
uniform2fv(location: WebGLUniformLocation, v: any): void;
uniform2fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform2i(location: WebGLUniformLocation, x: number, y: number): void;
uniform2iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3fv(location: WebGLUniformLocation, v: any): void;
uniform3fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4fv(location: WebGLUniformLocation, v: any): void;
uniform4fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4iv(location: WebGLUniformLocation, v: Int32Array): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
useProgram(program: WebGLProgram): void;
validateProgram(program: WebGLProgram): void;
vertexAttrib1f(indx: number, x: number): void;
vertexAttrib1fv(indx: number, values: any): void;
vertexAttrib1fv(indx: number, values: Float32Array): void;
vertexAttrib2f(indx: number, x: number, y: number): void;
vertexAttrib2fv(indx: number, values: any): void;
vertexAttrib2fv(indx: number, values: Float32Array): void;
vertexAttrib3f(indx: number, x: number, y: number, z: number): void;
vertexAttrib3fv(indx: number, values: any): void;
vertexAttrib3fv(indx: number, values: Float32Array): void;
vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;
vertexAttrib4fv(indx: number, values: any): void;
vertexAttrib4fv(indx: number, values: Float32Array): void;
vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;
viewport(x: number, y: number, width: number, height: number): void;
ACTIVE_ATTRIBUTES: number;
@@ -12088,7 +11993,6 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
locationbar: BarProp;
menubar: BarProp;
msAnimationStartTime: number;
msTemplatePrinter: MSTemplatePrinter;
name: string;
navigator: Navigator;
offscreenBuffering: string | boolean;
@@ -12825,7 +12729,6 @@ interface XMLHttpRequestEventTarget {
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
@@ -12846,8 +12749,6 @@ interface EventListenerObject {
handleEvent(evt: Event): void;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface MessageEventInit extends EventInit {
data?: any;
origin?: string;
@@ -12863,6 +12764,8 @@ interface ProgressEventInit extends EventInit {
total?: number;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
(message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
}
@@ -12923,7 +12826,6 @@ declare var location: Location;
declare var locationbar: BarProp;
declare var menubar: BarProp;
declare var msAnimationStartTime: number;
declare var msTemplatePrinter: MSTemplatePrinter;
declare var name: string;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
+27 -125
View File
@@ -5558,8 +5558,8 @@ interface AnalyserNode extends AudioNode {
smoothingTimeConstant: number;
getByteFrequencyData(array: Uint8Array): void;
getByteTimeDomainData(array: Uint8Array): void;
getFloatFrequencyData(array: any): void;
getFloatTimeDomainData(array: any): void;
getFloatFrequencyData(array: Float32Array): void;
getFloatTimeDomainData(array: Float32Array): void;
}
declare var AnalyserNode: {
@@ -5646,7 +5646,7 @@ interface AudioBuffer {
length: number;
numberOfChannels: number;
sampleRate: number;
getChannelData(channel: number): any;
getChannelData(channel: number): Float32Array;
}
declare var AudioBuffer: {
@@ -5690,7 +5690,7 @@ interface AudioContext extends EventTarget {
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
createOscillator(): OscillatorNode;
createPanner(): PannerNode;
createPeriodicWave(real: any, imag: any): PeriodicWave;
createPeriodicWave(real: Float32Array, imag: Float32Array): PeriodicWave;
createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
createStereoPanner(): StereoPannerNode;
createWaveShaper(): WaveShaperNode;
@@ -5748,7 +5748,7 @@ interface AudioParam {
linearRampToValueAtTime(value: number, endTime: number): void;
setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
setValueAtTime(value: number, startTime: number): void;
setValueCurveAtTime(values: any, startTime: number, duration: number): void;
setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
}
declare var AudioParam: {
@@ -5824,7 +5824,7 @@ interface BiquadFilterNode extends AudioNode {
frequency: AudioParam;
gain: AudioParam;
type: string;
getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void;
getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
}
declare var BiquadFilterNode: {
@@ -6423,7 +6423,7 @@ declare var CanvasPattern: {
interface CanvasRenderingContext2D {
canvas: HTMLCanvasElement;
fillStyle: any;
fillStyle: string | CanvasGradient | CanvasPattern;
font: string;
globalAlpha: number;
globalCompositeOperation: string;
@@ -6438,7 +6438,7 @@ interface CanvasRenderingContext2D {
shadowColor: string;
shadowOffsetX: number;
shadowOffsetY: number;
strokeStyle: any;
strokeStyle: string | CanvasGradient | CanvasPattern;
textAlign: string;
textBaseline: string;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
@@ -7806,8 +7806,6 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
importNode(importedNode: Node, deep: boolean): Node;
msElementsFromPoint(x: number, y: number): NodeList;
msElementsFromRect(left: number, top: number, width: number, height: number): NodeList;
msGetPrintDocumentForNamedFlow(flowName: string): Document;
msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void;
/**
* Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
* @param url Specifies a MIME type for the document.
@@ -12629,27 +12627,6 @@ declare var MSHTMLWebViewElement: {
new(): MSHTMLWebViewElement;
}
interface MSHeaderFooter {
URL: string;
dateLong: string;
dateShort: string;
font: string;
htmlFoot: string;
htmlHead: string;
page: number;
pageTotal: number;
textFoot: string;
textHead: string;
timeLong: string;
timeShort: string;
title: string;
}
declare var MSHeaderFooter: {
prototype: MSHeaderFooter;
new(): MSHeaderFooter;
}
interface MSInputMethodContext extends EventTarget {
compositionEndOffset: number;
compositionStartOffset: number;
@@ -12808,24 +12785,6 @@ declare var MSPointerEvent: {
new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;
}
interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget {
percentScale: number;
showHeaderFooter: boolean;
shrinkToFit: boolean;
drawPreviewPage(element: HTMLElement, pageNumber: number): void;
endPrint(): void;
getPrintTaskOptionValue(key: string): any;
invalidatePreview(): void;
setPageCount(pageCount: number): void;
startPrint(): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
declare var MSPrintManagerTemplatePrinter: {
prototype: MSPrintManagerTemplatePrinter;
new(): MSPrintManagerTemplatePrinter;
}
interface MSRangeCollection {
length: number;
item(index: number): Range;
@@ -12873,63 +12832,6 @@ declare var MSStreamReader: {
new(): MSStreamReader;
}
interface MSTemplatePrinter {
collate: boolean;
copies: number;
currentPage: boolean;
currentPageAvail: boolean;
duplex: boolean;
footer: string;
frameActive: boolean;
frameActiveEnabled: boolean;
frameAsShown: boolean;
framesetDocument: boolean;
header: string;
headerFooterFont: string;
marginBottom: number;
marginLeft: number;
marginRight: number;
marginTop: number;
orientation: string;
pageFrom: number;
pageHeight: number;
pageTo: number;
pageWidth: number;
selectedPages: boolean;
selection: boolean;
selectionEnabled: boolean;
unprintableBottom: number;
unprintableLeft: number;
unprintableRight: number;
unprintableTop: number;
usePrinterCopyCollate: boolean;
createHeaderFooter(): MSHeaderFooter;
deviceSupports(property: string): any;
ensurePrintDialogDefaults(): boolean;
getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginBottomImportant(pageRule: CSSPageRule): boolean;
getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginLeftImportant(pageRule: CSSPageRule): boolean;
getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginRightImportant(pageRule: CSSPageRule): boolean;
getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any;
getPageMarginTopImportant(pageRule: CSSPageRule): boolean;
printBlankPage(): void;
printNonNative(document: any): boolean;
printNonNativeFrames(document: any, activeFrame: boolean): void;
printPage(element: HTMLElement): void;
showPageSetupDialog(): boolean;
showPrintDialog(): boolean;
startDoc(title: string): boolean;
stopDoc(): void;
updatePageStatus(status: number): void;
}
declare var MSTemplatePrinter: {
prototype: MSTemplatePrinter;
new(): MSTemplatePrinter;
}
interface MSWebViewAsyncOperation extends EventTarget {
error: DOMError;
oncomplete: (ev: Event) => any;
@@ -13347,6 +13249,10 @@ declare var Node: {
}
interface NodeFilter {
acceptNode(n: Node): number;
}
declare var NodeFilter: {
FILTER_ACCEPT: number;
FILTER_REJECT: number;
FILTER_SKIP: number;
@@ -13364,7 +13270,6 @@ interface NodeFilter {
SHOW_PROCESSING_INSTRUCTION: number;
SHOW_TEXT: number;
}
declare var NodeFilter: NodeFilter;
interface NodeIterator {
expandEntityReferences: boolean;
@@ -14074,7 +13979,6 @@ declare var SVGDescElement: {
interface SVGElement extends Element {
id: string;
className: any;
onclick: (ev: MouseEvent) => any;
ondblclick: (ev: MouseEvent) => any;
onfocusin: (ev: FocusEvent) => any;
@@ -14088,6 +13992,7 @@ interface SVGElement extends Element {
ownerSVGElement: SVGSVGElement;
viewportElement: SVGElement;
xmlbase: string;
className: any;
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -16249,7 +16154,7 @@ declare var WEBGL_depth_texture: {
}
interface WaveShaperNode extends AudioNode {
curve: any;
curve: Float32Array;
oversample: string;
}
@@ -16436,34 +16341,34 @@ interface WebGLRenderingContext {
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
uniform1f(location: WebGLUniformLocation, x: number): void;
uniform1fv(location: WebGLUniformLocation, v: any): void;
uniform1fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform1i(location: WebGLUniformLocation, x: number): void;
uniform1iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform2f(location: WebGLUniformLocation, x: number, y: number): void;
uniform2fv(location: WebGLUniformLocation, v: any): void;
uniform2fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform2i(location: WebGLUniformLocation, x: number, y: number): void;
uniform2iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3fv(location: WebGLUniformLocation, v: any): void;
uniform3fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void;
uniform3iv(location: WebGLUniformLocation, v: Int32Array): void;
uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4fv(location: WebGLUniformLocation, v: any): void;
uniform4fv(location: WebGLUniformLocation, v: Float32Array): void;
uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
uniform4iv(location: WebGLUniformLocation, v: Int32Array): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void;
uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
useProgram(program: WebGLProgram): void;
validateProgram(program: WebGLProgram): void;
vertexAttrib1f(indx: number, x: number): void;
vertexAttrib1fv(indx: number, values: any): void;
vertexAttrib1fv(indx: number, values: Float32Array): void;
vertexAttrib2f(indx: number, x: number, y: number): void;
vertexAttrib2fv(indx: number, values: any): void;
vertexAttrib2fv(indx: number, values: Float32Array): void;
vertexAttrib3f(indx: number, x: number, y: number, z: number): void;
vertexAttrib3fv(indx: number, values: any): void;
vertexAttrib3fv(indx: number, values: Float32Array): void;
vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;
vertexAttrib4fv(indx: number, values: any): void;
vertexAttrib4fv(indx: number, values: Float32Array): void;
vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;
viewport(x: number, y: number, width: number, height: number): void;
ACTIVE_ATTRIBUTES: number;
@@ -17227,7 +17132,6 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
locationbar: BarProp;
menubar: BarProp;
msAnimationStartTime: number;
msTemplatePrinter: MSTemplatePrinter;
name: string;
navigator: Navigator;
offscreenBuffering: string | boolean;
@@ -17964,7 +17868,6 @@ interface XMLHttpRequestEventTarget {
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
@@ -17985,8 +17888,6 @@ interface EventListenerObject {
handleEvent(evt: Event): void;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface MessageEventInit extends EventInit {
data?: any;
origin?: string;
@@ -18002,6 +17903,8 @@ interface ProgressEventInit extends EventInit {
total?: number;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
(message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
}
@@ -18062,7 +17965,6 @@ declare var location: Location;
declare var locationbar: BarProp;
declare var menubar: BarProp;
declare var msAnimationStartTime: number;
declare var msTemplatePrinter: MSTemplatePrinter;
declare var name: string;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
+3 -4
View File
@@ -234,7 +234,7 @@ interface AudioBuffer {
length: number;
numberOfChannels: number;
sampleRate: number;
getChannelData(channel: number): any;
getChannelData(channel: number): Float32Array;
}
declare var AudioBuffer: {
@@ -1111,7 +1111,6 @@ interface WorkerUtils extends Object, WindowBase64 {
setTimeout(handler: any, timeout?: any, ...args: any[]): number;
}
interface BlobPropertyBag {
type?: string;
endings?: string;
@@ -1126,8 +1125,6 @@ interface EventListenerObject {
handleEvent(evt: Event): void;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface MessageEventInit extends EventInit {
data?: any;
origin?: string;
@@ -1143,6 +1140,8 @@ interface ProgressEventInit extends EventInit {
total?: number;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
(message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
}
+8884 -8314
View File
File diff suppressed because it is too large Load Diff
+10198 -9516
View File
File diff suppressed because it is too large Load Diff
+275 -254
View File
@@ -68,253 +68,255 @@ declare namespace ts {
PlusToken = 35,
MinusToken = 36,
AsteriskToken = 37,
SlashToken = 38,
PercentToken = 39,
PlusPlusToken = 40,
MinusMinusToken = 41,
LessThanLessThanToken = 42,
GreaterThanGreaterThanToken = 43,
GreaterThanGreaterThanGreaterThanToken = 44,
AmpersandToken = 45,
BarToken = 46,
CaretToken = 47,
ExclamationToken = 48,
TildeToken = 49,
AmpersandAmpersandToken = 50,
BarBarToken = 51,
QuestionToken = 52,
ColonToken = 53,
AtToken = 54,
EqualsToken = 55,
PlusEqualsToken = 56,
MinusEqualsToken = 57,
AsteriskEqualsToken = 58,
SlashEqualsToken = 59,
PercentEqualsToken = 60,
LessThanLessThanEqualsToken = 61,
GreaterThanGreaterThanEqualsToken = 62,
GreaterThanGreaterThanGreaterThanEqualsToken = 63,
AmpersandEqualsToken = 64,
BarEqualsToken = 65,
CaretEqualsToken = 66,
Identifier = 67,
BreakKeyword = 68,
CaseKeyword = 69,
CatchKeyword = 70,
ClassKeyword = 71,
ConstKeyword = 72,
ContinueKeyword = 73,
DebuggerKeyword = 74,
DefaultKeyword = 75,
DeleteKeyword = 76,
DoKeyword = 77,
ElseKeyword = 78,
EnumKeyword = 79,
ExportKeyword = 80,
ExtendsKeyword = 81,
FalseKeyword = 82,
FinallyKeyword = 83,
ForKeyword = 84,
FunctionKeyword = 85,
IfKeyword = 86,
ImportKeyword = 87,
InKeyword = 88,
InstanceOfKeyword = 89,
NewKeyword = 90,
NullKeyword = 91,
ReturnKeyword = 92,
SuperKeyword = 93,
SwitchKeyword = 94,
ThisKeyword = 95,
ThrowKeyword = 96,
TrueKeyword = 97,
TryKeyword = 98,
TypeOfKeyword = 99,
VarKeyword = 100,
VoidKeyword = 101,
WhileKeyword = 102,
WithKeyword = 103,
ImplementsKeyword = 104,
InterfaceKeyword = 105,
LetKeyword = 106,
PackageKeyword = 107,
PrivateKeyword = 108,
ProtectedKeyword = 109,
PublicKeyword = 110,
StaticKeyword = 111,
YieldKeyword = 112,
AbstractKeyword = 113,
AsKeyword = 114,
AnyKeyword = 115,
AsyncKeyword = 116,
AwaitKeyword = 117,
BooleanKeyword = 118,
ConstructorKeyword = 119,
DeclareKeyword = 120,
GetKeyword = 121,
IsKeyword = 122,
ModuleKeyword = 123,
NamespaceKeyword = 124,
RequireKeyword = 125,
NumberKeyword = 126,
SetKeyword = 127,
StringKeyword = 128,
SymbolKeyword = 129,
TypeKeyword = 130,
FromKeyword = 131,
OfKeyword = 132,
QualifiedName = 133,
ComputedPropertyName = 134,
TypeParameter = 135,
Parameter = 136,
Decorator = 137,
PropertySignature = 138,
PropertyDeclaration = 139,
MethodSignature = 140,
MethodDeclaration = 141,
Constructor = 142,
GetAccessor = 143,
SetAccessor = 144,
CallSignature = 145,
ConstructSignature = 146,
IndexSignature = 147,
TypePredicate = 148,
TypeReference = 149,
FunctionType = 150,
ConstructorType = 151,
TypeQuery = 152,
TypeLiteral = 153,
ArrayType = 154,
TupleType = 155,
UnionType = 156,
IntersectionType = 157,
ParenthesizedType = 158,
ObjectBindingPattern = 159,
ArrayBindingPattern = 160,
BindingElement = 161,
ArrayLiteralExpression = 162,
ObjectLiteralExpression = 163,
PropertyAccessExpression = 164,
ElementAccessExpression = 165,
CallExpression = 166,
NewExpression = 167,
TaggedTemplateExpression = 168,
TypeAssertionExpression = 169,
ParenthesizedExpression = 170,
FunctionExpression = 171,
ArrowFunction = 172,
DeleteExpression = 173,
TypeOfExpression = 174,
VoidExpression = 175,
AwaitExpression = 176,
PrefixUnaryExpression = 177,
PostfixUnaryExpression = 178,
BinaryExpression = 179,
ConditionalExpression = 180,
TemplateExpression = 181,
YieldExpression = 182,
SpreadElementExpression = 183,
ClassExpression = 184,
OmittedExpression = 185,
ExpressionWithTypeArguments = 186,
AsExpression = 187,
TemplateSpan = 188,
SemicolonClassElement = 189,
Block = 190,
VariableStatement = 191,
EmptyStatement = 192,
ExpressionStatement = 193,
IfStatement = 194,
DoStatement = 195,
WhileStatement = 196,
ForStatement = 197,
ForInStatement = 198,
ForOfStatement = 199,
ContinueStatement = 200,
BreakStatement = 201,
ReturnStatement = 202,
WithStatement = 203,
SwitchStatement = 204,
LabeledStatement = 205,
ThrowStatement = 206,
TryStatement = 207,
DebuggerStatement = 208,
VariableDeclaration = 209,
VariableDeclarationList = 210,
FunctionDeclaration = 211,
ClassDeclaration = 212,
InterfaceDeclaration = 213,
TypeAliasDeclaration = 214,
EnumDeclaration = 215,
ModuleDeclaration = 216,
ModuleBlock = 217,
CaseBlock = 218,
ImportEqualsDeclaration = 219,
ImportDeclaration = 220,
ImportClause = 221,
NamespaceImport = 222,
NamedImports = 223,
ImportSpecifier = 224,
ExportAssignment = 225,
ExportDeclaration = 226,
NamedExports = 227,
ExportSpecifier = 228,
MissingDeclaration = 229,
ExternalModuleReference = 230,
JsxElement = 231,
JsxSelfClosingElement = 232,
JsxOpeningElement = 233,
JsxText = 234,
JsxClosingElement = 235,
JsxAttribute = 236,
JsxSpreadAttribute = 237,
JsxExpression = 238,
CaseClause = 239,
DefaultClause = 240,
HeritageClause = 241,
CatchClause = 242,
PropertyAssignment = 243,
ShorthandPropertyAssignment = 244,
EnumMember = 245,
SourceFile = 246,
JSDocTypeExpression = 247,
JSDocAllType = 248,
JSDocUnknownType = 249,
JSDocArrayType = 250,
JSDocUnionType = 251,
JSDocTupleType = 252,
JSDocNullableType = 253,
JSDocNonNullableType = 254,
JSDocRecordType = 255,
JSDocRecordMember = 256,
JSDocTypeReference = 257,
JSDocOptionalType = 258,
JSDocFunctionType = 259,
JSDocVariadicType = 260,
JSDocConstructorType = 261,
JSDocThisType = 262,
JSDocComment = 263,
JSDocTag = 264,
JSDocParameterTag = 265,
JSDocReturnTag = 266,
JSDocTypeTag = 267,
JSDocTemplateTag = 268,
SyntaxList = 269,
Count = 270,
FirstAssignment = 55,
LastAssignment = 66,
FirstReservedWord = 68,
LastReservedWord = 103,
FirstKeyword = 68,
LastKeyword = 132,
FirstFutureReservedWord = 104,
LastFutureReservedWord = 112,
FirstTypeNode = 149,
LastTypeNode = 158,
AsteriskAsteriskToken = 38,
SlashToken = 39,
PercentToken = 40,
PlusPlusToken = 41,
MinusMinusToken = 42,
LessThanLessThanToken = 43,
GreaterThanGreaterThanToken = 44,
GreaterThanGreaterThanGreaterThanToken = 45,
AmpersandToken = 46,
BarToken = 47,
CaretToken = 48,
ExclamationToken = 49,
TildeToken = 50,
AmpersandAmpersandToken = 51,
BarBarToken = 52,
QuestionToken = 53,
ColonToken = 54,
AtToken = 55,
EqualsToken = 56,
PlusEqualsToken = 57,
MinusEqualsToken = 58,
AsteriskEqualsToken = 59,
AsteriskAsteriskEqualsToken = 60,
SlashEqualsToken = 61,
PercentEqualsToken = 62,
LessThanLessThanEqualsToken = 63,
GreaterThanGreaterThanEqualsToken = 64,
GreaterThanGreaterThanGreaterThanEqualsToken = 65,
AmpersandEqualsToken = 66,
BarEqualsToken = 67,
CaretEqualsToken = 68,
Identifier = 69,
BreakKeyword = 70,
CaseKeyword = 71,
CatchKeyword = 72,
ClassKeyword = 73,
ConstKeyword = 74,
ContinueKeyword = 75,
DebuggerKeyword = 76,
DefaultKeyword = 77,
DeleteKeyword = 78,
DoKeyword = 79,
ElseKeyword = 80,
EnumKeyword = 81,
ExportKeyword = 82,
ExtendsKeyword = 83,
FalseKeyword = 84,
FinallyKeyword = 85,
ForKeyword = 86,
FunctionKeyword = 87,
IfKeyword = 88,
ImportKeyword = 89,
InKeyword = 90,
InstanceOfKeyword = 91,
NewKeyword = 92,
NullKeyword = 93,
ReturnKeyword = 94,
SuperKeyword = 95,
SwitchKeyword = 96,
ThisKeyword = 97,
ThrowKeyword = 98,
TrueKeyword = 99,
TryKeyword = 100,
TypeOfKeyword = 101,
VarKeyword = 102,
VoidKeyword = 103,
WhileKeyword = 104,
WithKeyword = 105,
ImplementsKeyword = 106,
InterfaceKeyword = 107,
LetKeyword = 108,
PackageKeyword = 109,
PrivateKeyword = 110,
ProtectedKeyword = 111,
PublicKeyword = 112,
StaticKeyword = 113,
YieldKeyword = 114,
AbstractKeyword = 115,
AsKeyword = 116,
AnyKeyword = 117,
AsyncKeyword = 118,
AwaitKeyword = 119,
BooleanKeyword = 120,
ConstructorKeyword = 121,
DeclareKeyword = 122,
GetKeyword = 123,
IsKeyword = 124,
ModuleKeyword = 125,
NamespaceKeyword = 126,
RequireKeyword = 127,
NumberKeyword = 128,
SetKeyword = 129,
StringKeyword = 130,
SymbolKeyword = 131,
TypeKeyword = 132,
FromKeyword = 133,
OfKeyword = 134,
QualifiedName = 135,
ComputedPropertyName = 136,
TypeParameter = 137,
Parameter = 138,
Decorator = 139,
PropertySignature = 140,
PropertyDeclaration = 141,
MethodSignature = 142,
MethodDeclaration = 143,
Constructor = 144,
GetAccessor = 145,
SetAccessor = 146,
CallSignature = 147,
ConstructSignature = 148,
IndexSignature = 149,
TypePredicate = 150,
TypeReference = 151,
FunctionType = 152,
ConstructorType = 153,
TypeQuery = 154,
TypeLiteral = 155,
ArrayType = 156,
TupleType = 157,
UnionType = 158,
IntersectionType = 159,
ParenthesizedType = 160,
ObjectBindingPattern = 161,
ArrayBindingPattern = 162,
BindingElement = 163,
ArrayLiteralExpression = 164,
ObjectLiteralExpression = 165,
PropertyAccessExpression = 166,
ElementAccessExpression = 167,
CallExpression = 168,
NewExpression = 169,
TaggedTemplateExpression = 170,
TypeAssertionExpression = 171,
ParenthesizedExpression = 172,
FunctionExpression = 173,
ArrowFunction = 174,
DeleteExpression = 175,
TypeOfExpression = 176,
VoidExpression = 177,
AwaitExpression = 178,
PrefixUnaryExpression = 179,
PostfixUnaryExpression = 180,
BinaryExpression = 181,
ConditionalExpression = 182,
TemplateExpression = 183,
YieldExpression = 184,
SpreadElementExpression = 185,
ClassExpression = 186,
OmittedExpression = 187,
ExpressionWithTypeArguments = 188,
AsExpression = 189,
TemplateSpan = 190,
SemicolonClassElement = 191,
Block = 192,
VariableStatement = 193,
EmptyStatement = 194,
ExpressionStatement = 195,
IfStatement = 196,
DoStatement = 197,
WhileStatement = 198,
ForStatement = 199,
ForInStatement = 200,
ForOfStatement = 201,
ContinueStatement = 202,
BreakStatement = 203,
ReturnStatement = 204,
WithStatement = 205,
SwitchStatement = 206,
LabeledStatement = 207,
ThrowStatement = 208,
TryStatement = 209,
DebuggerStatement = 210,
VariableDeclaration = 211,
VariableDeclarationList = 212,
FunctionDeclaration = 213,
ClassDeclaration = 214,
InterfaceDeclaration = 215,
TypeAliasDeclaration = 216,
EnumDeclaration = 217,
ModuleDeclaration = 218,
ModuleBlock = 219,
CaseBlock = 220,
ImportEqualsDeclaration = 221,
ImportDeclaration = 222,
ImportClause = 223,
NamespaceImport = 224,
NamedImports = 225,
ImportSpecifier = 226,
ExportAssignment = 227,
ExportDeclaration = 228,
NamedExports = 229,
ExportSpecifier = 230,
MissingDeclaration = 231,
ExternalModuleReference = 232,
JsxElement = 233,
JsxSelfClosingElement = 234,
JsxOpeningElement = 235,
JsxText = 236,
JsxClosingElement = 237,
JsxAttribute = 238,
JsxSpreadAttribute = 239,
JsxExpression = 240,
CaseClause = 241,
DefaultClause = 242,
HeritageClause = 243,
CatchClause = 244,
PropertyAssignment = 245,
ShorthandPropertyAssignment = 246,
EnumMember = 247,
SourceFile = 248,
JSDocTypeExpression = 249,
JSDocAllType = 250,
JSDocUnknownType = 251,
JSDocArrayType = 252,
JSDocUnionType = 253,
JSDocTupleType = 254,
JSDocNullableType = 255,
JSDocNonNullableType = 256,
JSDocRecordType = 257,
JSDocRecordMember = 258,
JSDocTypeReference = 259,
JSDocOptionalType = 260,
JSDocFunctionType = 261,
JSDocVariadicType = 262,
JSDocConstructorType = 263,
JSDocThisType = 264,
JSDocComment = 265,
JSDocTag = 266,
JSDocParameterTag = 267,
JSDocReturnTag = 268,
JSDocTypeTag = 269,
JSDocTemplateTag = 270,
SyntaxList = 271,
Count = 272,
FirstAssignment = 56,
LastAssignment = 68,
FirstReservedWord = 70,
LastReservedWord = 105,
FirstKeyword = 70,
LastKeyword = 134,
FirstFutureReservedWord = 106,
LastFutureReservedWord = 114,
FirstTypeNode = 151,
LastTypeNode = 160,
FirstPunctuation = 15,
LastPunctuation = 66,
LastPunctuation = 68,
FirstToken = 0,
LastToken = 132,
LastToken = 134,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -322,8 +324,8 @@ declare namespace ts {
FirstTemplateToken = 11,
LastTemplateToken = 14,
FirstBinaryOperator = 25,
LastBinaryOperator = 66,
FirstNode = 133,
LastBinaryOperator = 68,
FirstNode = 135,
}
const enum NodeFlags {
Export = 1,
@@ -343,6 +345,7 @@ declare namespace ts {
OctalLiteral = 65536,
Namespace = 131072,
ExportContext = 262144,
ContainsThis = 524288,
Modifier = 2035,
AccessibilityModifier = 112,
BlockScoped = 49152,
@@ -438,6 +441,8 @@ declare namespace ts {
interface ShorthandPropertyAssignment extends ObjectLiteralElement {
name: Identifier;
questionToken?: Node;
equalsToken?: Node;
objectAssignmentInitializer?: Expression;
}
interface VariableLikeDeclaration extends Declaration {
propertyName?: Identifier;
@@ -530,18 +535,21 @@ declare namespace ts {
interface UnaryExpression extends Expression {
_unaryExpressionBrand: any;
}
interface PrefixUnaryExpression extends UnaryExpression {
interface IncrementExpression extends UnaryExpression {
_incrementExpressionBrand: any;
}
interface PrefixUnaryExpression extends IncrementExpression {
operator: SyntaxKind;
operand: UnaryExpression;
}
interface PostfixUnaryExpression extends PostfixExpression {
interface PostfixUnaryExpression extends IncrementExpression {
operand: LeftHandSideExpression;
operator: SyntaxKind;
}
interface PostfixExpression extends UnaryExpression {
_postfixExpressionBrand: any;
}
interface LeftHandSideExpression extends PostfixExpression {
interface LeftHandSideExpression extends IncrementExpression {
_leftHandSideExpressionBrand: any;
}
interface MemberExpression extends LeftHandSideExpression {
@@ -1082,6 +1090,7 @@ declare namespace ts {
decreaseIndent(): void;
clear(): void;
trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
reportInaccessibleThisError(): void;
}
const enum TypeFormatFlags {
None = 0,
@@ -1202,6 +1211,7 @@ declare namespace ts {
Instantiated = 131072,
ObjectLiteral = 524288,
ESSymbol = 16777216,
ThisType = 33554432,
StringLike = 258,
NumberLike = 132,
ObjectType = 80896,
@@ -1223,6 +1233,7 @@ declare namespace ts {
typeParameters: TypeParameter[];
outerTypeParameters: TypeParameter[];
localTypeParameters: TypeParameter[];
thisType: TypeParameter;
}
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
declaredProperties: Symbol[];
@@ -1337,7 +1348,6 @@ declare namespace ts {
watch?: boolean;
isolatedModules?: boolean;
experimentalDecorators?: boolean;
experimentalAsyncFunctions?: boolean;
emitDecoratorMetadata?: boolean;
moduleResolution?: ModuleResolutionKind;
[option: string]: string | number | boolean;
@@ -1348,6 +1358,8 @@ declare namespace ts {
AMD = 2,
UMD = 3,
System = 4,
ES6 = 5,
ES2015 = 5,
}
const enum JsxEmit {
None = 0,
@@ -1366,6 +1378,7 @@ declare namespace ts {
ES3 = 0,
ES5 = 1,
ES6 = 2,
ES2015 = 2,
Latest = 2,
}
const enum LanguageVariant {
@@ -1417,7 +1430,8 @@ declare namespace ts {
write(s: string): void;
readFile(path: string, encoding?: string): string;
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
watchFile?(path: string, callback: (path: string) => void): FileWatcher;
watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher;
watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher;
resolvePath(path: string): string;
fileExists(path: string): boolean;
directoryExists(path: string): boolean;
@@ -1507,6 +1521,7 @@ declare namespace ts {
*/
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
function getTypeParameterOwner(d: Declaration): Declaration;
function arrayStructurallyIsEqualTo<T>(array1: Array<T>, array2: Array<T>): boolean;
}
declare namespace ts {
function getNodeConstructor(kind: SyntaxKind): new () => Node;
@@ -1542,7 +1557,7 @@ declare namespace ts {
* @param fileName The path to the config file
* @param jsonText The text of the config file
*/
function parseConfigFileText(fileName: string, jsonText: string): {
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
@@ -1552,7 +1567,7 @@ declare namespace ts {
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine;
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine;
}
declare namespace ts {
/** The version of the language service API */
@@ -1775,6 +1790,12 @@ declare namespace ts {
TabSize: number;
NewLineCharacter: string;
ConvertTabsToSpaces: boolean;
IndentStyle: IndentStyle;
}
enum IndentStyle {
None = 0,
Block = 1,
Smart = 2,
}
interface FormatCodeOptions extends EditorOptions {
InsertSpaceAfterCommaDelimiter: boolean;
+11679 -10829
View File
File diff suppressed because it is too large Load Diff
+275 -254
View File
@@ -68,253 +68,255 @@ declare namespace ts {
PlusToken = 35,
MinusToken = 36,
AsteriskToken = 37,
SlashToken = 38,
PercentToken = 39,
PlusPlusToken = 40,
MinusMinusToken = 41,
LessThanLessThanToken = 42,
GreaterThanGreaterThanToken = 43,
GreaterThanGreaterThanGreaterThanToken = 44,
AmpersandToken = 45,
BarToken = 46,
CaretToken = 47,
ExclamationToken = 48,
TildeToken = 49,
AmpersandAmpersandToken = 50,
BarBarToken = 51,
QuestionToken = 52,
ColonToken = 53,
AtToken = 54,
EqualsToken = 55,
PlusEqualsToken = 56,
MinusEqualsToken = 57,
AsteriskEqualsToken = 58,
SlashEqualsToken = 59,
PercentEqualsToken = 60,
LessThanLessThanEqualsToken = 61,
GreaterThanGreaterThanEqualsToken = 62,
GreaterThanGreaterThanGreaterThanEqualsToken = 63,
AmpersandEqualsToken = 64,
BarEqualsToken = 65,
CaretEqualsToken = 66,
Identifier = 67,
BreakKeyword = 68,
CaseKeyword = 69,
CatchKeyword = 70,
ClassKeyword = 71,
ConstKeyword = 72,
ContinueKeyword = 73,
DebuggerKeyword = 74,
DefaultKeyword = 75,
DeleteKeyword = 76,
DoKeyword = 77,
ElseKeyword = 78,
EnumKeyword = 79,
ExportKeyword = 80,
ExtendsKeyword = 81,
FalseKeyword = 82,
FinallyKeyword = 83,
ForKeyword = 84,
FunctionKeyword = 85,
IfKeyword = 86,
ImportKeyword = 87,
InKeyword = 88,
InstanceOfKeyword = 89,
NewKeyword = 90,
NullKeyword = 91,
ReturnKeyword = 92,
SuperKeyword = 93,
SwitchKeyword = 94,
ThisKeyword = 95,
ThrowKeyword = 96,
TrueKeyword = 97,
TryKeyword = 98,
TypeOfKeyword = 99,
VarKeyword = 100,
VoidKeyword = 101,
WhileKeyword = 102,
WithKeyword = 103,
ImplementsKeyword = 104,
InterfaceKeyword = 105,
LetKeyword = 106,
PackageKeyword = 107,
PrivateKeyword = 108,
ProtectedKeyword = 109,
PublicKeyword = 110,
StaticKeyword = 111,
YieldKeyword = 112,
AbstractKeyword = 113,
AsKeyword = 114,
AnyKeyword = 115,
AsyncKeyword = 116,
AwaitKeyword = 117,
BooleanKeyword = 118,
ConstructorKeyword = 119,
DeclareKeyword = 120,
GetKeyword = 121,
IsKeyword = 122,
ModuleKeyword = 123,
NamespaceKeyword = 124,
RequireKeyword = 125,
NumberKeyword = 126,
SetKeyword = 127,
StringKeyword = 128,
SymbolKeyword = 129,
TypeKeyword = 130,
FromKeyword = 131,
OfKeyword = 132,
QualifiedName = 133,
ComputedPropertyName = 134,
TypeParameter = 135,
Parameter = 136,
Decorator = 137,
PropertySignature = 138,
PropertyDeclaration = 139,
MethodSignature = 140,
MethodDeclaration = 141,
Constructor = 142,
GetAccessor = 143,
SetAccessor = 144,
CallSignature = 145,
ConstructSignature = 146,
IndexSignature = 147,
TypePredicate = 148,
TypeReference = 149,
FunctionType = 150,
ConstructorType = 151,
TypeQuery = 152,
TypeLiteral = 153,
ArrayType = 154,
TupleType = 155,
UnionType = 156,
IntersectionType = 157,
ParenthesizedType = 158,
ObjectBindingPattern = 159,
ArrayBindingPattern = 160,
BindingElement = 161,
ArrayLiteralExpression = 162,
ObjectLiteralExpression = 163,
PropertyAccessExpression = 164,
ElementAccessExpression = 165,
CallExpression = 166,
NewExpression = 167,
TaggedTemplateExpression = 168,
TypeAssertionExpression = 169,
ParenthesizedExpression = 170,
FunctionExpression = 171,
ArrowFunction = 172,
DeleteExpression = 173,
TypeOfExpression = 174,
VoidExpression = 175,
AwaitExpression = 176,
PrefixUnaryExpression = 177,
PostfixUnaryExpression = 178,
BinaryExpression = 179,
ConditionalExpression = 180,
TemplateExpression = 181,
YieldExpression = 182,
SpreadElementExpression = 183,
ClassExpression = 184,
OmittedExpression = 185,
ExpressionWithTypeArguments = 186,
AsExpression = 187,
TemplateSpan = 188,
SemicolonClassElement = 189,
Block = 190,
VariableStatement = 191,
EmptyStatement = 192,
ExpressionStatement = 193,
IfStatement = 194,
DoStatement = 195,
WhileStatement = 196,
ForStatement = 197,
ForInStatement = 198,
ForOfStatement = 199,
ContinueStatement = 200,
BreakStatement = 201,
ReturnStatement = 202,
WithStatement = 203,
SwitchStatement = 204,
LabeledStatement = 205,
ThrowStatement = 206,
TryStatement = 207,
DebuggerStatement = 208,
VariableDeclaration = 209,
VariableDeclarationList = 210,
FunctionDeclaration = 211,
ClassDeclaration = 212,
InterfaceDeclaration = 213,
TypeAliasDeclaration = 214,
EnumDeclaration = 215,
ModuleDeclaration = 216,
ModuleBlock = 217,
CaseBlock = 218,
ImportEqualsDeclaration = 219,
ImportDeclaration = 220,
ImportClause = 221,
NamespaceImport = 222,
NamedImports = 223,
ImportSpecifier = 224,
ExportAssignment = 225,
ExportDeclaration = 226,
NamedExports = 227,
ExportSpecifier = 228,
MissingDeclaration = 229,
ExternalModuleReference = 230,
JsxElement = 231,
JsxSelfClosingElement = 232,
JsxOpeningElement = 233,
JsxText = 234,
JsxClosingElement = 235,
JsxAttribute = 236,
JsxSpreadAttribute = 237,
JsxExpression = 238,
CaseClause = 239,
DefaultClause = 240,
HeritageClause = 241,
CatchClause = 242,
PropertyAssignment = 243,
ShorthandPropertyAssignment = 244,
EnumMember = 245,
SourceFile = 246,
JSDocTypeExpression = 247,
JSDocAllType = 248,
JSDocUnknownType = 249,
JSDocArrayType = 250,
JSDocUnionType = 251,
JSDocTupleType = 252,
JSDocNullableType = 253,
JSDocNonNullableType = 254,
JSDocRecordType = 255,
JSDocRecordMember = 256,
JSDocTypeReference = 257,
JSDocOptionalType = 258,
JSDocFunctionType = 259,
JSDocVariadicType = 260,
JSDocConstructorType = 261,
JSDocThisType = 262,
JSDocComment = 263,
JSDocTag = 264,
JSDocParameterTag = 265,
JSDocReturnTag = 266,
JSDocTypeTag = 267,
JSDocTemplateTag = 268,
SyntaxList = 269,
Count = 270,
FirstAssignment = 55,
LastAssignment = 66,
FirstReservedWord = 68,
LastReservedWord = 103,
FirstKeyword = 68,
LastKeyword = 132,
FirstFutureReservedWord = 104,
LastFutureReservedWord = 112,
FirstTypeNode = 149,
LastTypeNode = 158,
AsteriskAsteriskToken = 38,
SlashToken = 39,
PercentToken = 40,
PlusPlusToken = 41,
MinusMinusToken = 42,
LessThanLessThanToken = 43,
GreaterThanGreaterThanToken = 44,
GreaterThanGreaterThanGreaterThanToken = 45,
AmpersandToken = 46,
BarToken = 47,
CaretToken = 48,
ExclamationToken = 49,
TildeToken = 50,
AmpersandAmpersandToken = 51,
BarBarToken = 52,
QuestionToken = 53,
ColonToken = 54,
AtToken = 55,
EqualsToken = 56,
PlusEqualsToken = 57,
MinusEqualsToken = 58,
AsteriskEqualsToken = 59,
AsteriskAsteriskEqualsToken = 60,
SlashEqualsToken = 61,
PercentEqualsToken = 62,
LessThanLessThanEqualsToken = 63,
GreaterThanGreaterThanEqualsToken = 64,
GreaterThanGreaterThanGreaterThanEqualsToken = 65,
AmpersandEqualsToken = 66,
BarEqualsToken = 67,
CaretEqualsToken = 68,
Identifier = 69,
BreakKeyword = 70,
CaseKeyword = 71,
CatchKeyword = 72,
ClassKeyword = 73,
ConstKeyword = 74,
ContinueKeyword = 75,
DebuggerKeyword = 76,
DefaultKeyword = 77,
DeleteKeyword = 78,
DoKeyword = 79,
ElseKeyword = 80,
EnumKeyword = 81,
ExportKeyword = 82,
ExtendsKeyword = 83,
FalseKeyword = 84,
FinallyKeyword = 85,
ForKeyword = 86,
FunctionKeyword = 87,
IfKeyword = 88,
ImportKeyword = 89,
InKeyword = 90,
InstanceOfKeyword = 91,
NewKeyword = 92,
NullKeyword = 93,
ReturnKeyword = 94,
SuperKeyword = 95,
SwitchKeyword = 96,
ThisKeyword = 97,
ThrowKeyword = 98,
TrueKeyword = 99,
TryKeyword = 100,
TypeOfKeyword = 101,
VarKeyword = 102,
VoidKeyword = 103,
WhileKeyword = 104,
WithKeyword = 105,
ImplementsKeyword = 106,
InterfaceKeyword = 107,
LetKeyword = 108,
PackageKeyword = 109,
PrivateKeyword = 110,
ProtectedKeyword = 111,
PublicKeyword = 112,
StaticKeyword = 113,
YieldKeyword = 114,
AbstractKeyword = 115,
AsKeyword = 116,
AnyKeyword = 117,
AsyncKeyword = 118,
AwaitKeyword = 119,
BooleanKeyword = 120,
ConstructorKeyword = 121,
DeclareKeyword = 122,
GetKeyword = 123,
IsKeyword = 124,
ModuleKeyword = 125,
NamespaceKeyword = 126,
RequireKeyword = 127,
NumberKeyword = 128,
SetKeyword = 129,
StringKeyword = 130,
SymbolKeyword = 131,
TypeKeyword = 132,
FromKeyword = 133,
OfKeyword = 134,
QualifiedName = 135,
ComputedPropertyName = 136,
TypeParameter = 137,
Parameter = 138,
Decorator = 139,
PropertySignature = 140,
PropertyDeclaration = 141,
MethodSignature = 142,
MethodDeclaration = 143,
Constructor = 144,
GetAccessor = 145,
SetAccessor = 146,
CallSignature = 147,
ConstructSignature = 148,
IndexSignature = 149,
TypePredicate = 150,
TypeReference = 151,
FunctionType = 152,
ConstructorType = 153,
TypeQuery = 154,
TypeLiteral = 155,
ArrayType = 156,
TupleType = 157,
UnionType = 158,
IntersectionType = 159,
ParenthesizedType = 160,
ObjectBindingPattern = 161,
ArrayBindingPattern = 162,
BindingElement = 163,
ArrayLiteralExpression = 164,
ObjectLiteralExpression = 165,
PropertyAccessExpression = 166,
ElementAccessExpression = 167,
CallExpression = 168,
NewExpression = 169,
TaggedTemplateExpression = 170,
TypeAssertionExpression = 171,
ParenthesizedExpression = 172,
FunctionExpression = 173,
ArrowFunction = 174,
DeleteExpression = 175,
TypeOfExpression = 176,
VoidExpression = 177,
AwaitExpression = 178,
PrefixUnaryExpression = 179,
PostfixUnaryExpression = 180,
BinaryExpression = 181,
ConditionalExpression = 182,
TemplateExpression = 183,
YieldExpression = 184,
SpreadElementExpression = 185,
ClassExpression = 186,
OmittedExpression = 187,
ExpressionWithTypeArguments = 188,
AsExpression = 189,
TemplateSpan = 190,
SemicolonClassElement = 191,
Block = 192,
VariableStatement = 193,
EmptyStatement = 194,
ExpressionStatement = 195,
IfStatement = 196,
DoStatement = 197,
WhileStatement = 198,
ForStatement = 199,
ForInStatement = 200,
ForOfStatement = 201,
ContinueStatement = 202,
BreakStatement = 203,
ReturnStatement = 204,
WithStatement = 205,
SwitchStatement = 206,
LabeledStatement = 207,
ThrowStatement = 208,
TryStatement = 209,
DebuggerStatement = 210,
VariableDeclaration = 211,
VariableDeclarationList = 212,
FunctionDeclaration = 213,
ClassDeclaration = 214,
InterfaceDeclaration = 215,
TypeAliasDeclaration = 216,
EnumDeclaration = 217,
ModuleDeclaration = 218,
ModuleBlock = 219,
CaseBlock = 220,
ImportEqualsDeclaration = 221,
ImportDeclaration = 222,
ImportClause = 223,
NamespaceImport = 224,
NamedImports = 225,
ImportSpecifier = 226,
ExportAssignment = 227,
ExportDeclaration = 228,
NamedExports = 229,
ExportSpecifier = 230,
MissingDeclaration = 231,
ExternalModuleReference = 232,
JsxElement = 233,
JsxSelfClosingElement = 234,
JsxOpeningElement = 235,
JsxText = 236,
JsxClosingElement = 237,
JsxAttribute = 238,
JsxSpreadAttribute = 239,
JsxExpression = 240,
CaseClause = 241,
DefaultClause = 242,
HeritageClause = 243,
CatchClause = 244,
PropertyAssignment = 245,
ShorthandPropertyAssignment = 246,
EnumMember = 247,
SourceFile = 248,
JSDocTypeExpression = 249,
JSDocAllType = 250,
JSDocUnknownType = 251,
JSDocArrayType = 252,
JSDocUnionType = 253,
JSDocTupleType = 254,
JSDocNullableType = 255,
JSDocNonNullableType = 256,
JSDocRecordType = 257,
JSDocRecordMember = 258,
JSDocTypeReference = 259,
JSDocOptionalType = 260,
JSDocFunctionType = 261,
JSDocVariadicType = 262,
JSDocConstructorType = 263,
JSDocThisType = 264,
JSDocComment = 265,
JSDocTag = 266,
JSDocParameterTag = 267,
JSDocReturnTag = 268,
JSDocTypeTag = 269,
JSDocTemplateTag = 270,
SyntaxList = 271,
Count = 272,
FirstAssignment = 56,
LastAssignment = 68,
FirstReservedWord = 70,
LastReservedWord = 105,
FirstKeyword = 70,
LastKeyword = 134,
FirstFutureReservedWord = 106,
LastFutureReservedWord = 114,
FirstTypeNode = 151,
LastTypeNode = 160,
FirstPunctuation = 15,
LastPunctuation = 66,
LastPunctuation = 68,
FirstToken = 0,
LastToken = 132,
LastToken = 134,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -322,8 +324,8 @@ declare namespace ts {
FirstTemplateToken = 11,
LastTemplateToken = 14,
FirstBinaryOperator = 25,
LastBinaryOperator = 66,
FirstNode = 133,
LastBinaryOperator = 68,
FirstNode = 135,
}
const enum NodeFlags {
Export = 1,
@@ -343,6 +345,7 @@ declare namespace ts {
OctalLiteral = 65536,
Namespace = 131072,
ExportContext = 262144,
ContainsThis = 524288,
Modifier = 2035,
AccessibilityModifier = 112,
BlockScoped = 49152,
@@ -438,6 +441,8 @@ declare namespace ts {
interface ShorthandPropertyAssignment extends ObjectLiteralElement {
name: Identifier;
questionToken?: Node;
equalsToken?: Node;
objectAssignmentInitializer?: Expression;
}
interface VariableLikeDeclaration extends Declaration {
propertyName?: Identifier;
@@ -530,18 +535,21 @@ declare namespace ts {
interface UnaryExpression extends Expression {
_unaryExpressionBrand: any;
}
interface PrefixUnaryExpression extends UnaryExpression {
interface IncrementExpression extends UnaryExpression {
_incrementExpressionBrand: any;
}
interface PrefixUnaryExpression extends IncrementExpression {
operator: SyntaxKind;
operand: UnaryExpression;
}
interface PostfixUnaryExpression extends PostfixExpression {
interface PostfixUnaryExpression extends IncrementExpression {
operand: LeftHandSideExpression;
operator: SyntaxKind;
}
interface PostfixExpression extends UnaryExpression {
_postfixExpressionBrand: any;
}
interface LeftHandSideExpression extends PostfixExpression {
interface LeftHandSideExpression extends IncrementExpression {
_leftHandSideExpressionBrand: any;
}
interface MemberExpression extends LeftHandSideExpression {
@@ -1082,6 +1090,7 @@ declare namespace ts {
decreaseIndent(): void;
clear(): void;
trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
reportInaccessibleThisError(): void;
}
const enum TypeFormatFlags {
None = 0,
@@ -1202,6 +1211,7 @@ declare namespace ts {
Instantiated = 131072,
ObjectLiteral = 524288,
ESSymbol = 16777216,
ThisType = 33554432,
StringLike = 258,
NumberLike = 132,
ObjectType = 80896,
@@ -1223,6 +1233,7 @@ declare namespace ts {
typeParameters: TypeParameter[];
outerTypeParameters: TypeParameter[];
localTypeParameters: TypeParameter[];
thisType: TypeParameter;
}
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
declaredProperties: Symbol[];
@@ -1337,7 +1348,6 @@ declare namespace ts {
watch?: boolean;
isolatedModules?: boolean;
experimentalDecorators?: boolean;
experimentalAsyncFunctions?: boolean;
emitDecoratorMetadata?: boolean;
moduleResolution?: ModuleResolutionKind;
[option: string]: string | number | boolean;
@@ -1348,6 +1358,8 @@ declare namespace ts {
AMD = 2,
UMD = 3,
System = 4,
ES6 = 5,
ES2015 = 5,
}
const enum JsxEmit {
None = 0,
@@ -1366,6 +1378,7 @@ declare namespace ts {
ES3 = 0,
ES5 = 1,
ES6 = 2,
ES2015 = 2,
Latest = 2,
}
const enum LanguageVariant {
@@ -1417,7 +1430,8 @@ declare namespace ts {
write(s: string): void;
readFile(path: string, encoding?: string): string;
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
watchFile?(path: string, callback: (path: string) => void): FileWatcher;
watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher;
watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher;
resolvePath(path: string): string;
fileExists(path: string): boolean;
directoryExists(path: string): boolean;
@@ -1507,6 +1521,7 @@ declare namespace ts {
*/
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
function getTypeParameterOwner(d: Declaration): Declaration;
function arrayStructurallyIsEqualTo<T>(array1: Array<T>, array2: Array<T>): boolean;
}
declare namespace ts {
function getNodeConstructor(kind: SyntaxKind): new () => Node;
@@ -1542,7 +1557,7 @@ declare namespace ts {
* @param fileName The path to the config file
* @param jsonText The text of the config file
*/
function parseConfigFileText(fileName: string, jsonText: string): {
function parseConfigFileTextToJson(fileName: string, jsonText: string): {
config?: any;
error?: Diagnostic;
};
@@ -1552,7 +1567,7 @@ declare namespace ts {
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine;
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine;
}
declare namespace ts {
/** The version of the language service API */
@@ -1775,6 +1790,12 @@ declare namespace ts {
TabSize: number;
NewLineCharacter: string;
ConvertTabsToSpaces: boolean;
IndentStyle: IndentStyle;
}
enum IndentStyle {
None = 0,
Block = 1,
Smart = 2,
}
interface FormatCodeOptions extends EditorOptions {
InsertSpaceAfterCommaDelimiter: boolean;
+11679 -10829
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "http://typescriptlang.org/",
"version": "1.7.0",
"version": "1.8.0",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
+38 -6
View File
@@ -18,6 +18,13 @@ function main(): void {
return;
}
function writeFile(fileName: string, contents: string) {
// TODO: Fix path joining
var inputDirectory = inputFilePath.substr(0,inputFilePath.lastIndexOf("/"));
var fileOutputPath = inputDirectory + "/" + fileName;
sys.writeFile(fileOutputPath, contents);
}
var inputFilePath = sys.args[0].replace(/\\/g, "/");
var inputStr = sys.readFile(inputFilePath);
@@ -28,11 +35,10 @@ function main(): void {
var infoFileOutput = buildInfoFileOutput(diagnosticMessages, nameMap);
checkForUniqueCodes(names, diagnosticMessages);
writeFile("diagnosticInformationMap.generated.ts", infoFileOutput);
// TODO: Fix path joining
var inputDirectory = inputFilePath.substr(0,inputFilePath.lastIndexOf("/"));
var fileOutputPath = inputDirectory + "/diagnosticInformationMap.generated.ts";
sys.writeFile(fileOutputPath, infoFileOutput);
var messageOutput = buildDiagnosticMessageOutput(diagnosticMessages, nameMap);
writeFile("diagnosticMessages.generated.json", messageOutput);
}
function checkForUniqueCodes(messages: string[], diagnosticTable: InputDiagnosticMessageTable) {
@@ -85,12 +91,14 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
for (var i = 0; i < names.length; i++) {
var name = names[i];
var diagnosticDetails = messageTable[name];
var propName = convertPropertyName(nameMap[name]);
result +=
' ' + convertPropertyName(nameMap[name]) +
' ' + propName +
': { code: ' + diagnosticDetails.code +
', category: DiagnosticCategory.' + diagnosticDetails.category +
', key: "' + name.replace(/[\"]/g, '\\"') + '"' +
', key: "' + createKey(propName, diagnosticDetails.code) + '"' +
', message: "' + name.replace(/[\"]/g, '\\"') + '"' +
' },\r\n';
}
@@ -99,6 +107,30 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
return result;
}
function buildDiagnosticMessageOutput(messageTable: InputDiagnosticMessageTable, nameMap: ts.Map<string>): string {
var result =
'{';
var names = Utilities.getObjectKeys(messageTable);
for (var i = 0; i < names.length; i++) {
var name = names[i];
var diagnosticDetails = messageTable[name];
var propName = convertPropertyName(nameMap[name]);
result += '\r\n "' + createKey(propName, diagnosticDetails.code) + '"' + ' : "' + name.replace(/[\"]/g, '\\"') + '"';
if (i !== names.length - 1) {
result += ',';
}
}
result += '\r\n}';
return result;
}
function createKey(name: string, code: number) : string {
return name.slice(0, 100) + '_' + code;
}
function convertPropertyName(origName: string): string {
var result = origName.split("").map(char => {
if (char === '*') { return "_Asterisk"; }
+29
View File
@@ -0,0 +1,29 @@
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = "The '|' and '&' operators must be surrounded by single spaces";
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithWalker(new TypeOperatorSpacingWalker(sourceFile, this.getOptions()));
}
}
class TypeOperatorSpacingWalker extends Lint.RuleWalker {
public visitNode(node: ts.Node) {
if (node.kind === ts.SyntaxKind.UnionType || node.kind === ts.SyntaxKind.IntersectionType) {
let types = (<ts.UnionOrIntersectionTypeNode>node).types;
let expectedStart = types[0].end + 2; // space, | or &
for (let i = 1; i < types.length; i++) {
let currentType = types[i];
if (expectedStart !== currentType.pos || currentType.getLeadingTriviaWidth() !== 1) {
const failure = this.createFailure(currentType.pos, currentType.getWidth(), Rule.FAILURE_STRING);
this.addFailure(failure);
}
expectedStart = currentType.end + 2;
}
}
super.visitNode(node);
}
}
+202 -192
View File
@@ -2845,23 +2845,29 @@ namespace ts {
return type.resolvedBaseConstructorType;
}
function hasClassBaseType(type: InterfaceType): boolean {
return !!forEach(getBaseTypes(type), t => !!(t.symbol.flags & SymbolFlags.Class));
}
function getBaseTypes(type: InterfaceType): ObjectType[] {
let isClass = type.symbol.flags & SymbolFlags.Class;
let isInterface = type.symbol.flags & SymbolFlags.Interface;
if (!type.resolvedBaseTypes) {
if (type.symbol.flags & SymbolFlags.Class) {
if (!isClass && !isInterface) {
Debug.fail("type must be class or interface");
}
if (isClass) {
resolveBaseTypesOfClass(type);
}
else if (type.symbol.flags & SymbolFlags.Interface) {
if (isInterface) {
resolveBaseTypesOfInterface(type);
}
else {
Debug.fail("type must be class or interface");
}
}
return type.resolvedBaseTypes;
}
function resolveBaseTypesOfClass(type: InterfaceType): void {
type.resolvedBaseTypes = emptyArray;
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
let baseContructorType = getBaseConstructorTypeOfClass(type);
if (!(baseContructorType.flags & TypeFlags.ObjectType)) {
return;
@@ -2897,11 +2903,16 @@ namespace ts {
typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType));
return;
}
type.resolvedBaseTypes = [baseType];
if (type.resolvedBaseTypes === emptyArray) {
type.resolvedBaseTypes = [baseType];
}
else {
type.resolvedBaseTypes.push(baseType);
}
}
function resolveBaseTypesOfInterface(type: InterfaceType): void {
type.resolvedBaseTypes = [];
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
for (let declaration of type.symbol.declarations) {
if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(<InterfaceDeclaration>declaration)) {
for (let node of getInterfaceBaseTypeNodes(<InterfaceDeclaration>declaration)) {
@@ -2909,7 +2920,12 @@ namespace ts {
if (baseType !== unknownType) {
if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) {
if (type !== baseType && !hasBaseType(<InterfaceType>baseType, type)) {
type.resolvedBaseTypes.push(baseType);
if (type.resolvedBaseTypes === emptyArray) {
type.resolvedBaseTypes = [baseType];
}
else {
type.resolvedBaseTypes.push(baseType);
}
}
else {
error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType));
@@ -3252,7 +3268,7 @@ namespace ts {
}
function getDefaultConstructSignatures(classType: InterfaceType): Signature[] {
if (!getBaseTypes(classType).length) {
if (!hasClassBaseType(classType)) {
return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)];
}
let baseConstructorType = getBaseConstructorTypeOfClass(classType);
@@ -3714,7 +3730,9 @@ namespace ts {
function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature {
let links = getNodeLinks(declaration);
if (!links.resolvedSignature) {
let classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClassOrInterface((<ClassDeclaration>declaration.parent).symbol) : undefined;
let classType = declaration.kind === SyntaxKind.Constructor ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol((<ClassDeclaration>declaration.parent).symbol))
: undefined;
let typeParameters = classType ? classType.localTypeParameters :
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
let parameters: Symbol[] = [];
@@ -4895,7 +4913,7 @@ namespace ts {
if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) {
// Report structural errors only if we haven't reported any errors yet
let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo;
if (result = objectTypeRelatedTo(apparentType, <ObjectType>target, reportStructuralErrors)) {
if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) {
errorInfo = saveErrorInfo;
return result;
}
@@ -4917,7 +4935,7 @@ namespace ts {
return result;
}
}
return objectTypeRelatedTo(<ObjectType>source, <ObjectType>target, /*reportErrors*/ false);
return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false);
}
if (source.flags & TypeFlags.TypeParameter && target.flags & TypeFlags.TypeParameter) {
return typeParameterIdenticalTo(<TypeParameter>source, <TypeParameter>target);
@@ -4944,34 +4962,34 @@ namespace ts {
resolved.stringIndexType || resolved.numberIndexType || getPropertyOfType(type, name)) {
return true;
}
return false;
}
if (type.flags & TypeFlags.UnionOrIntersection) {
else if (type.flags & TypeFlags.UnionOrIntersection) {
for (let t of (<UnionOrIntersectionType>type).types) {
if (isKnownProperty(t, name)) {
return true;
}
}
return false;
}
return true;
return false;
}
function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
for (let prop of getPropertiesOfObjectType(source)) {
if (!isKnownProperty(target, prop.name)) {
if (reportErrors) {
// We know *exactly* where things went wrong when comparing the types.
// Use this property as the error node as this will be more helpful in
// reasoning about what went wrong.
errorNode = prop.valueDeclaration;
reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
symbolToString(prop),
typeToString(target));
if (someConstituentTypeHasKind(target, TypeFlags.ObjectType)) {
for (let prop of getPropertiesOfObjectType(source)) {
if (!isKnownProperty(target, prop.name)) {
if (reportErrors) {
// We know *exactly* where things went wrong when comparing the types.
// Use this property as the error node as this will be more helpful in
// reasoning about what went wrong.
errorNode = prop.valueDeclaration;
reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
symbolToString(prop), typeToString(target));
}
return true;
}
return true;
}
}
return false;
}
function eachTypeRelatedToSomeType(source: UnionOrIntersectionType, target: UnionOrIntersectionType): Ternary {
@@ -5071,11 +5089,11 @@ namespace ts {
// Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
// equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion
// and issue an error. Otherwise, actually compare the structure of the two types.
function objectTypeRelatedTo(source: Type, target: Type, reportErrors: boolean): Ternary {
function objectTypeRelatedTo(apparentSource: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary {
if (overflow) {
return Ternary.False;
}
let id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id;
let id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id;
let related = relation[id];
if (related !== undefined) {
// If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate
@@ -5102,28 +5120,28 @@ namespace ts {
maybeStack = [];
expandingFlags = 0;
}
sourceStack[depth] = source;
sourceStack[depth] = apparentSource;
targetStack[depth] = target;
maybeStack[depth] = {};
maybeStack[depth][id] = RelationComparisonResult.Succeeded;
depth++;
let saveExpandingFlags = expandingFlags;
if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1;
if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) expandingFlags |= 1;
if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2;
let result: Ternary;
if (expandingFlags === 3) {
result = Ternary.Maybe;
}
else {
result = propertiesRelatedTo(source, target, reportErrors);
result = propertiesRelatedTo(apparentSource, target, reportErrors);
if (result) {
result &= signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors);
result &= signaturesRelatedTo(apparentSource, target, SignatureKind.Call, reportErrors);
if (result) {
result &= signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors);
result &= signaturesRelatedTo(apparentSource, target, SignatureKind.Construct, reportErrors);
if (result) {
result &= stringIndexTypesRelatedTo(source, target, reportErrors);
result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors);
if (result) {
result &= numberIndexTypesRelatedTo(source, target, reportErrors);
result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors);
}
}
}
@@ -5454,12 +5472,17 @@ namespace ts {
return result;
}
function stringIndexTypesRelatedTo(source: Type, target: Type, reportErrors: boolean): Ternary {
function stringIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary {
if (relation === identityRelation) {
return indexTypesIdenticalTo(IndexKind.String, source, target);
}
let targetType = getIndexTypeOfType(target, IndexKind.String);
if (targetType && !(targetType.flags & TypeFlags.Any)) {
if (targetType) {
if ((targetType.flags & TypeFlags.Any) && !(originalSource.flags & TypeFlags.Primitive)) {
// non-primitive assignment to any is always allowed, eg
// `var x: { [index: string]: any } = { property: 12 };`
return Ternary.True;
}
let sourceType = getIndexTypeOfType(source, IndexKind.String);
if (!sourceType) {
if (reportErrors) {
@@ -5479,12 +5502,17 @@ namespace ts {
return Ternary.True;
}
function numberIndexTypesRelatedTo(source: Type, target: Type, reportErrors: boolean): Ternary {
function numberIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary {
if (relation === identityRelation) {
return indexTypesIdenticalTo(IndexKind.Number, source, target);
}
let targetType = getIndexTypeOfType(target, IndexKind.Number);
if (targetType && !(targetType.flags & TypeFlags.Any)) {
if (targetType) {
if ((targetType.flags & TypeFlags.Any) && !(originalSource.flags & TypeFlags.Primitive)) {
// non-primitive assignment to any is always allowed, eg
// `var x: { [index: number]: any } = { property: 12 };`
return Ternary.True;
}
let sourceStringType = getIndexTypeOfType(source, IndexKind.String);
let sourceNumberType = getIndexTypeOfType(source, IndexKind.Number);
if (!(sourceStringType || sourceNumberType)) {
@@ -5608,11 +5636,10 @@ namespace ts {
// M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N
source = getErasedSignature(source);
target = getErasedSignature(target);
let sourceLen = source.parameters.length;
let targetLen = target.parameters.length;
for (let i = 0; i < targetLen; i++) {
let s = source.hasRestParameter && i === sourceLen - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]);
let t = target.hasRestParameter && i === targetLen - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]);
let s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]);
let t = isRestParameterIndex(target, i) ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]);
let related = compareTypes(s, t);
if (!related) {
return Ternary.False;
@@ -5625,6 +5652,10 @@ namespace ts {
return result;
}
function isRestParameterIndex(signature: Signature, parameterIndex: number) {
return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1;
}
function isSupertypeOfEach(candidate: Type, types: Type[]): boolean {
for (let type of types) {
if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false;
@@ -6578,7 +6609,7 @@ namespace ts {
while (current && !nodeStartsNewLexicalEnvironment(current)) {
if (isIterationStatement(current, /*lookInLabeledStatements*/ false)) {
if (inFunction) {
grammarErrorOnFirstToken(current, Diagnostics.Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher, declarationNameToString(node));
getNodeLinks(current).flags |= NodeCheckFlags.LoopWithBlockScopedBindingCapturedInFunction;
}
// mark value declaration so during emit they can have a special handling
getNodeLinks(<VariableDeclaration>symbol.valueDeclaration).flags |= NodeCheckFlags.BlockScopedBindingInLoop;
@@ -6786,8 +6817,9 @@ namespace ts {
}
// If last parameter is contextually rest parameter get its type
if (indexOfParameter === (func.parameters.length - 1) &&
funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) {
if (funcHasRestParameters &&
indexOfParameter === (func.parameters.length - 1) &&
isRestParameterIndex(contextualSignature, func.parameters.length - 1)) {
return getTypeOfSymbol(lastOrUndefined(contextualSignature.parameters));
}
}
@@ -7019,7 +7051,7 @@ namespace ts {
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined;
}
function getContextualTypeForJsxExpression(expr: JsxExpression|JsxSpreadAttribute): Type {
function getContextualTypeForJsxExpression(expr: JsxExpression | JsxSpreadAttribute): Type {
// Contextual type only applies to JSX expressions that are in attribute assignments (not in 'Children' positions)
if (expr.parent.kind === SyntaxKind.JsxAttribute) {
let attrib = <JsxAttribute>expr.parent;
@@ -7510,9 +7542,6 @@ namespace ts {
case SyntaxKind.JsxSelfClosingElement:
checkJsxSelfClosingElement(<JsxSelfClosingElement>child);
break;
default:
// No checks for JSX Text
Debug.assert(child.kind === SyntaxKind.JsxText);
}
}
@@ -7530,7 +7559,7 @@ namespace ts {
/**
* Returns true iff React would emit this tag name as a string rather than an identifier or qualified name
*/
function isJsxIntrinsicIdentifier(tagName: Identifier|QualifiedName) {
function isJsxIntrinsicIdentifier(tagName: Identifier | QualifiedName) {
if (tagName.kind === SyntaxKind.QualifiedName) {
return false;
}
@@ -7616,7 +7645,7 @@ namespace ts {
/// If this is a class-based tag (otherwise returns undefined), returns the symbol of the class
/// type or factory function.
/// Otherwise, returns unknownSymbol.
function getJsxElementTagSymbol(node: JsxOpeningLikeElement|JsxClosingElement): Symbol {
function getJsxElementTagSymbol(node: JsxOpeningLikeElement | JsxClosingElement): Symbol {
let flags: JsxFlags = JsxFlags.UnknownElement;
let links = getNodeLinks(node);
if (!links.resolvedSymbol) {
@@ -7629,7 +7658,7 @@ namespace ts {
}
return links.resolvedSymbol;
function lookupIntrinsicTag(node: JsxOpeningLikeElement|JsxClosingElement): Symbol {
function lookupIntrinsicTag(node: JsxOpeningLikeElement | JsxClosingElement): Symbol {
let intrinsicElementsType = getJsxIntrinsicElementsType();
if (intrinsicElementsType !== unknownType) {
// Property case
@@ -7657,7 +7686,7 @@ namespace ts {
}
}
function lookupClassTag(node: JsxOpeningLikeElement|JsxClosingElement): Symbol {
function lookupClassTag(node: JsxOpeningLikeElement | JsxClosingElement): Symbol {
let valueSymbol: Symbol = resolveJsxTagName(node);
// Look up the value in the current scope
@@ -7671,7 +7700,7 @@ namespace ts {
return valueSymbol || unknownSymbol;
}
function resolveJsxTagName(node: JsxOpeningLikeElement|JsxClosingElement): Symbol {
function resolveJsxTagName(node: JsxOpeningLikeElement | JsxClosingElement): Symbol {
if (node.tagName.kind === SyntaxKind.Identifier) {
let tag = <Identifier>node.tagName;
let sym = getResolvedSymbol(tag);
@@ -8381,7 +8410,7 @@ namespace ts {
// If spread arguments are present, check that they correspond to a rest parameter. If so, no
// further checking is necessary.
if (spreadArgIndex >= 0) {
return signature.hasRestParameter && spreadArgIndex >= signature.parameters.length - 1;
return isRestParameterIndex(signature, spreadArgIndex);
}
// Too many arguments implies incorrect arity.
@@ -8646,39 +8675,36 @@ namespace ts {
*/
function getEffectiveDecoratorFirstArgumentType(node: Node): Type {
// The first argument to a decorator is its `target`.
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ClassExpression:
// For a class decorator, the `target` is the type of the class (e.g. the
// "static" or "constructor" side of the class)
if (node.kind === SyntaxKind.ClassDeclaration) {
// For a class decorator, the `target` is the type of the class (e.g. the
// "static" or "constructor" side of the class)
let classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
if (node.kind === SyntaxKind.Parameter) {
// For a parameter decorator, the `target` is the parent type of the
// parameter's containing method.
node = node.parent;
if (node.kind === SyntaxKind.Constructor) {
let classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
case SyntaxKind.Parameter:
// For a parameter decorator, the `target` is the parent type of the
// parameter's containing method.
node = node.parent;
if (node.kind === SyntaxKind.Constructor) {
let classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
// fall-through
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
// For a property or method decorator, the `target` is the
// "static"-side type of the parent of the member if the member is
// declared "static"; otherwise, it is the "instance"-side type of the
// parent of the member.
return getParentTypeOfClassElement(<ClassElement>node);
default:
Debug.fail("Unsupported decorator target.");
return unknownType;
}
}
if (node.kind === SyntaxKind.PropertyDeclaration ||
node.kind === SyntaxKind.MethodDeclaration ||
node.kind === SyntaxKind.GetAccessor ||
node.kind === SyntaxKind.SetAccessor) {
// For a property or method decorator, the `target` is the
// "static"-side type of the parent of the member if the member is
// declared "static"; otherwise, it is the "instance"-side type of the
// parent of the member.
return getParentTypeOfClassElement(<ClassElement>node);
}
Debug.fail("Unsupported decorator target.");
return unknownType;
}
/**
@@ -8698,57 +8724,54 @@ namespace ts {
*/
function getEffectiveDecoratorSecondArgumentType(node: Node) {
// The second argument to a decorator is its `propertyKey`
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
Debug.fail("Class decorators should not have a second synthetic argument.");
return unknownType;
if (node.kind === SyntaxKind.ClassDeclaration) {
Debug.fail("Class decorators should not have a second synthetic argument.");
return unknownType;
}
case SyntaxKind.Parameter:
node = node.parent;
if (node.kind === SyntaxKind.Constructor) {
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
return anyType;
}
if (node.kind === SyntaxKind.Parameter) {
node = node.parent;
if (node.kind === SyntaxKind.Constructor) {
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
return anyType;
}
// For a non-constructor parameter decorator, the `propertyKey` will be either
// a string or a symbol, based on the name of the parameter's containing method.
// fall-through
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
// The `propertyKey` for a property or method decorator will be a
// string literal type if the member name is an identifier, number, or string;
// otherwise, if the member name is a computed property name it will
// be either string or symbol.
let element = <ClassElement>node;
switch (element.name.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.NumericLiteral:
case SyntaxKind.StringLiteral:
return getStringLiteralType(<StringLiteral>element.name);
case SyntaxKind.ComputedPropertyName:
let nameType = checkComputedPropertyName(<ComputedPropertyName>element.name);
if (allConstituentTypesHaveKind(nameType, TypeFlags.ESSymbol)) {
return nameType;
}
else {
return stringType;
}
default:
Debug.fail("Unsupported property name.");
return unknownType;
}
default:
Debug.fail("Unsupported decorator target.");
return unknownType;
}
if (node.kind === SyntaxKind.PropertyDeclaration ||
node.kind === SyntaxKind.MethodDeclaration ||
node.kind === SyntaxKind.GetAccessor ||
node.kind === SyntaxKind.SetAccessor) {
// The `propertyKey` for a property or method decorator will be a
// string literal type if the member name is an identifier, number, or string;
// otherwise, if the member name is a computed property name it will
// be either string or symbol.
let element = <ClassElement>node;
switch (element.name.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.NumericLiteral:
case SyntaxKind.StringLiteral:
return getStringLiteralType(<StringLiteral>element.name);
case SyntaxKind.ComputedPropertyName:
let nameType = checkComputedPropertyName(<ComputedPropertyName>element.name);
if (allConstituentTypesHaveKind(nameType, TypeFlags.ESSymbol)) {
return nameType;
}
else {
return stringType;
}
default:
Debug.fail("Unsupported property name.");
return unknownType;
}
}
Debug.fail("Unsupported decorator target.");
return unknownType;
}
/**
@@ -8761,31 +8784,32 @@ namespace ts {
function getEffectiveDecoratorThirdArgumentType(node: Node) {
// The third argument to a decorator is either its `descriptor` for a method decorator
// or its `parameterIndex` for a paramter decorator
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
Debug.fail("Class decorators should not have a third synthetic argument.");
return unknownType;
case SyntaxKind.Parameter:
// The `parameterIndex` for a parameter decorator is always a number
return numberType;
case SyntaxKind.PropertyDeclaration:
Debug.fail("Property decorators should not have a third synthetic argument.");
return unknownType;
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
// for the type of the member.
let propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
default:
Debug.fail("Unsupported decorator target.");
return unknownType;
if (node.kind === SyntaxKind.ClassDeclaration) {
Debug.fail("Class decorators should not have a third synthetic argument.");
return unknownType;
}
if (node.kind === SyntaxKind.Parameter) {
// The `parameterIndex` for a parameter decorator is always a number
return numberType;
}
if (node.kind === SyntaxKind.PropertyDeclaration) {
Debug.fail("Property decorators should not have a third synthetic argument.");
return unknownType;
}
if (node.kind === SyntaxKind.MethodDeclaration ||
node.kind === SyntaxKind.GetAccessor ||
node.kind === SyntaxKind.SetAccessor) {
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
// for the type of the member.
let propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
Debug.fail("Unsupported decorator target.");
return unknownType;
}
/**
@@ -9377,7 +9401,7 @@ namespace ts {
let contextualParameterType = getTypeAtPosition(context, i);
assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
}
if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) {
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
let parameter = lastOrUndefined(signature.parameters);
let contextualParameterType = getTypeOfSymbol(lastOrUndefined(context.parameters));
assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
@@ -9390,7 +9414,9 @@ namespace ts {
if (isBindingPattern(node.name)) {
for (let element of (<BindingPattern>node.name).elements) {
if (element.kind !== SyntaxKind.OmittedExpression) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
if (element.name.kind === SyntaxKind.Identifier) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
}
assignBindingElementTypes(element);
}
}
@@ -11051,7 +11077,13 @@ namespace ts {
function getEffectiveDeclarationFlags(n: Node, flagsToCheck: NodeFlags): NodeFlags {
let flags = getCombinedNodeFlags(n);
if (n.parent.kind !== SyntaxKind.InterfaceDeclaration && isInAmbientContext(n)) {
// children of classes (even ambient classes) should not be marked as ambient or export
// because those flags have no useful semantics there.
if (n.parent.kind !== SyntaxKind.InterfaceDeclaration &&
n.parent.kind !== SyntaxKind.ClassDeclaration &&
n.parent.kind !== SyntaxKind.ClassExpression &&
isInAmbientContext(n)) {
if (!(flags & NodeFlags.Ambient)) {
// It is nested in an ambient context, which means it is automatically exported
flags |= NodeFlags.Export;
@@ -12874,11 +12906,6 @@ namespace ts {
}
checkClassLikeDeclaration(node);
// Interfaces cannot be merged with non-ambient classes.
if (getSymbolOfNode(node).flags & SymbolFlags.Interface && !isInAmbientContext(node)) {
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
}
forEach(node.members, checkSourceElement);
}
@@ -13164,16 +13191,6 @@ namespace ts {
checkIndexConstraints(type);
}
}
// Interfaces cannot merge with non-ambient classes.
if (symbol && symbol.declarations) {
for (let declaration of symbol.declarations) {
if (declaration.kind === SyntaxKind.ClassDeclaration && !isInAmbientContext(declaration)) {
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
break;
}
}
}
}
forEach(getInterfaceBaseTypeNodes(node), heritageElement => {
if (!isSupportedExpressionWithTypeArguments(heritageElement)) {
@@ -14565,6 +14582,10 @@ namespace ts {
// Emitter support
function isArgumentsLocalBinding(node: Identifier): boolean {
return getReferencedValueSymbol(node) === argumentsSymbol;
}
function moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean {
let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
@@ -14897,7 +14918,8 @@ namespace ts {
getReferencedValueDeclaration,
getTypeReferenceSerializationKind,
isOptionalParameter,
moduleExportsSomeValue
moduleExportsSomeValue,
isArgumentsLocalBinding
};
}
@@ -15580,7 +15602,7 @@ namespace ts {
}
}
function checkGrammarJsxElement(node: JsxOpeningElement|JsxSelfClosingElement) {
function checkGrammarJsxElement(node: JsxOpeningLikeElement) {
const seen: Map<boolean> = {};
for (let attr of node.attributes) {
if (attr.kind === SyntaxKind.JsxSpreadAttribute) {
@@ -15724,21 +15746,6 @@ namespace ts {
}
}
function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean {
switch (node.kind) {
case SyntaxKind.ForStatement:
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement:
case SyntaxKind.DoStatement:
case SyntaxKind.WhileStatement:
return true;
case SyntaxKind.LabeledStatement:
return lookInLabeledStatements && isIterationStatement((<LabeledStatement>node).statement, lookInLabeledStatements);
}
return false;
}
function checkGrammarBreakOrContinueStatement(node: BreakOrContinueStatement): boolean {
let current: Node = node;
while (current) {
@@ -15992,11 +15999,14 @@ namespace ts {
// DeclarationElement:
// ExportAssignment
// export_opt InterfaceDeclaration
// export_opt TypeAliasDeclaration
// export_opt ImportDeclaration
// export_opt ExternalImportDeclaration
// export_opt AmbientDeclaration
//
// TODO: The spec needs to be amended to reflect this grammar.
if (node.kind === SyntaxKind.InterfaceDeclaration ||
node.kind === SyntaxKind.TypeAliasDeclaration ||
node.kind === SyntaxKind.ImportDeclaration ||
node.kind === SyntaxKind.ImportEqualsDeclaration ||
node.kind === SyntaxKind.ExportDeclaration ||
+54 -51
View File
@@ -79,9 +79,9 @@ namespace ts {
"es6": ModuleKind.ES6,
"es2015": ModuleKind.ES2015,
},
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
paramType: Diagnostics.KIND,
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es6
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es2015
},
{
name: "newLine",
@@ -212,9 +212,9 @@ namespace ts {
"es6": ScriptTarget.ES6,
"es2015": ScriptTarget.ES2015,
},
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental,
paramType: Diagnostics.VERSION,
error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES2015
},
{
name: "version",
@@ -410,63 +410,19 @@ namespace ts {
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
* @param host Instance of ParseConfigHost used to enumerate files in folder.
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine {
let errors: Diagnostic[] = [];
let { options, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath);
return {
options: getCompilerOptions(),
options,
fileNames: getFileNames(),
errors
};
function getCompilerOptions(): CompilerOptions {
let options: CompilerOptions = {};
let optionNameMap: Map<CommandLineOption> = {};
forEach(optionDeclarations, option => {
optionNameMap[option.name] = option;
});
let jsonOptions = json["compilerOptions"];
if (jsonOptions) {
for (let id in jsonOptions) {
if (hasProperty(optionNameMap, id)) {
let opt = optionNameMap[id];
let optType = opt.type;
let value = jsonOptions[id];
let expectedType = typeof optType === "string" ? optType : "string";
if (typeof value === expectedType) {
if (typeof optType !== "string") {
let key = value.toLowerCase();
if (hasProperty(optType, key)) {
value = optType[key];
}
else {
errors.push(createCompilerDiagnostic((<CommandLineOptionOfCustomType>opt).error));
value = 0;
}
}
if (opt.isFilePath) {
value = normalizePath(combinePaths(basePath, value));
if (value === "") {
value = ".";
}
}
options[opt.name] = value;
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, id, expectedType));
}
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Unknown_compiler_option_0, id));
}
}
}
return options;
}
function getFileNames(): string[] {
let fileNames: string[] = [];
if (hasProperty(json, "files")) {
@@ -501,4 +457,51 @@ namespace ts {
return fileNames;
}
}
export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string): { options: CompilerOptions, errors: Diagnostic[] } {
let options: CompilerOptions = {};
let errors: Diagnostic[] = [];
if (!jsonOptions) {
return { options, errors };
}
let optionNameMap = arrayToMap(optionDeclarations, opt => opt.name);
for (let id in jsonOptions) {
if (hasProperty(optionNameMap, id)) {
let opt = optionNameMap[id];
let optType = opt.type;
let value = jsonOptions[id];
let expectedType = typeof optType === "string" ? optType : "string";
if (typeof value === expectedType) {
if (typeof optType !== "string") {
let key = value.toLowerCase();
if (hasProperty(optType, key)) {
value = optType[key];
}
else {
errors.push(createCompilerDiagnostic((<CommandLineOptionOfCustomType>opt).error));
value = 0;
}
}
if (opt.isFilePath) {
value = normalizePath(combinePaths(basePath, value));
if (value === "") {
value = ".";
}
}
options[opt.name] = value;
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, id, expectedType));
}
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Unknown_compiler_option_0, id));
}
}
return { options, errors };
}
}
+17 -19
View File
@@ -365,10 +365,10 @@ namespace ts {
export let localizedDiagnosticMessages: Map<string> = undefined;
export function getLocaleSpecificMessage(message: string) {
return localizedDiagnosticMessages && localizedDiagnosticMessages[message]
? localizedDiagnosticMessages[message]
: message;
export function getLocaleSpecificMessage(message: DiagnosticMessage) {
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key]
? localizedDiagnosticMessages[message.key]
: message.message;
}
export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic;
@@ -383,7 +383,7 @@ namespace ts {
Debug.assert(end <= file.text.length, `end must be the bounds of the file. ${ end } > ${ file.text.length }`);
}
let text = getLocaleSpecificMessage(message.key);
let text = getLocaleSpecificMessage(message);
if (arguments.length > 4) {
text = formatStringFromArgs(text, arguments, 4);
@@ -402,7 +402,7 @@ namespace ts {
export function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic;
export function createCompilerDiagnostic(message: DiagnosticMessage): Diagnostic {
let text = getLocaleSpecificMessage(message.key);
let text = getLocaleSpecificMessage(message);
if (arguments.length > 1) {
text = formatStringFromArgs(text, arguments, 1);
@@ -421,7 +421,7 @@ namespace ts {
export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain;
export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage): DiagnosticMessageChain {
let text = getLocaleSpecificMessage(message.key);
let text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
text = formatStringFromArgs(text, arguments, 2);
@@ -775,7 +775,7 @@ namespace ts {
};
export interface ObjectAllocator {
getNodeConstructor(kind: SyntaxKind): new () => Node;
getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node;
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type;
getSignatureConstructor(): new (checker: TypeChecker) => Signature;
@@ -796,15 +796,13 @@ namespace ts {
export let objectAllocator: ObjectAllocator = {
getNodeConstructor: kind => {
function Node() {
function Node(pos: number, end: number) {
this.pos = pos;
this.end = end;
this.flags = NodeFlags.None;
this.parent = undefined;
}
Node.prototype = {
kind: kind,
pos: -1,
end: -1,
flags: 0,
parent: undefined,
};
Node.prototype = { kind };
return <any>Node;
},
getSymbolConstructor: () => <any>Symbol,
@@ -844,9 +842,9 @@ namespace ts {
export function copyListRemovingItem<T>(item: T, list: T[]) {
let copiedList: T[] = [];
for (var i = 0, len = list.length; i < len; i++) {
if (list[i] !== item) {
copiedList.push(list[i]);
for (let e of list) {
if (e !== item) {
copiedList.push(e);
}
}
return copiedList;
+16 -24
View File
@@ -627,7 +627,7 @@
"category": "Error",
"code": 1203
},
"Cannot compile modules into 'es6' when targeting 'ES5' or lower.": {
"Cannot compile modules into 'es2015' when targeting 'ES5' or lower.": {
"category": "Error",
"code": 1204
},
@@ -1620,10 +1620,6 @@
"category": "Error",
"code":2517
},
"Only an ambient class can be merged with an interface.": {
"category": "Error",
"code": 2518
},
"Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions.": {
"category": "Error",
"code": 2520
@@ -1716,14 +1712,14 @@
"category": "Error",
"code": 2654
},
"Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": {
"category": "Error",
"code": 2655
},
"Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.": {
"category": "Error",
"code": 2656
},
"JSX expressions must have one parent element": {
"category": "Error",
"code": 2657
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
"code": 4000
@@ -2004,10 +2000,6 @@
"category": "Error",
"code": 4082
},
"Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.": {
"category": "Error",
"code": 4091
},
"The current host does not support the '{0}' option.": {
"category": "Error",
"code": 5001
@@ -2044,7 +2036,7 @@
"category": "Error",
"code": 5042
},
"Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": {
"Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.": {
"category": "Error",
"code": 5047
},
@@ -2105,11 +2097,11 @@
"category": "Message",
"code": 6010
},
"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": {
"category": "Message",
"code": 6015
},
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es6'": {
"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)": {
"category": "Message",
"code": 6015
},
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'": {
"category": "Message",
"code": 6016
},
@@ -2193,14 +2185,14 @@
"category": "Error",
"code": 6045
},
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es6'.": {
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es2015'.": {
"category": "Error",
"code": 6046
},
"Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.": {
"category": "Error",
"code": 6047
},
"Argument for '--target' option must be 'ES3', 'ES5', or 'ES2015'.": {
"category": "Error",
"code": 6047
},
"Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'.": {
"category": "Error",
"code": 6048
+600 -45
View File
@@ -379,6 +379,105 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return true;
}
const enum Jump {
Break = 1 << 1,
Continue = 1 << 2,
Return = 1 << 3
}
interface ConvertedLoopState {
/*
* set of labels that occured inside the converted loop
* used to determine if labeled jump can be emitted as is or it should be dispatched to calling code
*/
labels?: Map<string>;
/*
* collection of labeled jumps that transfer control outside the converted loop.
* maps store association 'label -> labelMarker' where
* - label - value of label as it apprear in code
* - label marker - return value that should be interpreted by calling code as 'jump to <label>'
*/
labeledNonLocalBreaks?: Map<string>;
labeledNonLocalContinues?: Map<string>;
/*
* set of non-labeled jumps that transfer control outside the converted loop
* used to emit dispatching logic in the caller of converted loop
*/
nonLocalJumps?: Jump;
/*
* set of non-labeled jumps that should be interpreted as local
* i.e. if converted loop contains normal loop or switch statement then inside this loop break should be treated as local jump
*/
allowedNonLabeledJumps?: Jump;
/*
* alias for 'arguments' object from the calling code stack frame
* i.e.
* for (let x;;) <statement that captures x in closure and uses 'arguments'>
* should be converted to
* var loop = function(x) { <code where 'arguments' is replaced witg 'arguments_1'> }
* var arguments_1 = arguments
* for (var x;;) loop(x);
* otherwise semantics of the code will be different since 'arguments' inside converted loop body
* will refer to function that holds converted loop.
* This value is set on demand.
*/
argumentsName?: string;
/*
* list of non-block scoped variable declarations that appear inside converted loop
* such variable declarations should be moved outside the loop body
* for (let x;;) {
* var y = 1;
* ...
* }
* should be converted to
* var loop = function(x) {
* y = 1;
* ...
* }
* var y;
* for (var x;;) loop(x);
*/
hoistedLocalVariables?: Identifier[];
}
function setLabeledJump(state: ConvertedLoopState, isBreak: boolean, labelText: string, labelMarker: string): void {
if (isBreak) {
if (!state.labeledNonLocalBreaks) {
state.labeledNonLocalBreaks = {};
}
state.labeledNonLocalBreaks[labelText] = labelMarker;
}
else {
if (!state.labeledNonLocalContinues) {
state.labeledNonLocalContinues = {};
}
state.labeledNonLocalContinues[labelText] = labelMarker;
}
}
function hoistVariableDeclarationFromLoop(state: ConvertedLoopState, declaration: VariableDeclaration): void {
if (!state.hoistedLocalVariables) {
state.hoistedLocalVariables = [];
}
visit(declaration.name);
function visit(node: Identifier | BindingPattern) {
if (node.kind === SyntaxKind.Identifier) {
state.hoistedLocalVariables.push((<Identifier>node));
}
else {
for (const element of (<BindingPattern>node).elements) {
visit(element.name);
}
}
}
}
function emitJavaScript(jsFilePath: string, root?: SourceFile) {
let writer = createTextWriter(newLine);
let { write, writeTextOfNode, writeLine, increaseIndent, decreaseIndent } = writer;
@@ -396,6 +495,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
let nodeToGeneratedName: string[] = [];
let computedPropertyNamesToGeneratedNames: string[];
let convertedLoopState: ConvertedLoopState;
let extendsEmitted = false;
let decorateEmitted = false;
let paramEmitted = false;
@@ -1404,10 +1505,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emit(span.literal);
}
function jsxEmitReact(node: JsxElement|JsxSelfClosingElement) {
function jsxEmitReact(node: JsxElement | JsxSelfClosingElement) {
/// Emit a tag name, which is either '"div"' for lower-cased names, or
/// 'Div' for upper-cased or dotted names
function emitTagName(name: Identifier|QualifiedName) {
function emitTagName(name: Identifier | QualifiedName) {
if (name.kind === SyntaxKind.Identifier && isIntrinsicJsxName((<Identifier>name).text)) {
write("\"");
emit(name);
@@ -1557,7 +1658,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
}
function jsxEmitPreserve(node: JsxElement|JsxSelfClosingElement) {
function jsxEmitPreserve(node: JsxElement | JsxSelfClosingElement) {
function emitJsxAttribute(node: JsxAttribute) {
emit(node.name);
if (node.initializer) {
@@ -1572,7 +1673,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write("}");
}
function emitAttributes(attribs: NodeArray<JsxAttribute|JsxSpreadAttribute>) {
function emitAttributes(attribs: NodeArray<JsxAttribute | JsxSpreadAttribute>) {
for (let i = 0, n = attribs.length; i < n; i++) {
if (i > 0) {
write(" ");
@@ -1588,7 +1689,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
}
function emitJsxOpeningOrSelfClosingElement(node: JsxOpeningElement|JsxSelfClosingElement) {
function emitJsxOpeningOrSelfClosingElement(node: JsxOpeningElement | JsxSelfClosingElement) {
write("<");
emit(node.tagName);
if (node.attributes.length > 0 || (node.kind === SyntaxKind.JsxSelfClosingElement)) {
@@ -1769,34 +1870,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write(".");
}
}
else if (modulekind !== ModuleKind.ES6) {
let declaration = resolver.getReferencedImportDeclaration(node);
if (declaration) {
if (declaration.kind === SyntaxKind.ImportClause) {
// Identifier references default import
write(getGeneratedNameForNode(<ImportDeclaration>declaration.parent));
write(languageVersion === ScriptTarget.ES3 ? "[\"default\"]" : ".default");
return;
}
else if (declaration.kind === SyntaxKind.ImportSpecifier) {
// Identifier references named import
write(getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent));
let name = (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name;
let identifier = getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === ScriptTarget.ES3 && identifier === "default") {
write(`["default"]`);
else {
if (modulekind !== ModuleKind.ES6) {
let declaration = resolver.getReferencedImportDeclaration(node);
if (declaration) {
if (declaration.kind === SyntaxKind.ImportClause) {
// Identifier references default import
write(getGeneratedNameForNode(<ImportDeclaration>declaration.parent));
write(languageVersion === ScriptTarget.ES3 ? "[\"default\"]" : ".default");
return;
}
else {
write(".");
write(identifier);
else if (declaration.kind === SyntaxKind.ImportSpecifier) {
// Identifier references named import
write(getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent));
let name = (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name;
let identifier = getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === ScriptTarget.ES3 && identifier === "default") {
write(`["default"]`);
}
else {
write(".");
write(identifier);
}
return;
}
return;
}
}
declaration = resolver.getReferencedNestedRedeclaration(node);
if (declaration) {
write(getGeneratedNameForNode(declaration.name));
return;
if (languageVersion !== ScriptTarget.ES6) {
let declaration = resolver.getReferencedNestedRedeclaration(node);
if (declaration) {
write(getGeneratedNameForNode(declaration.name));
return;
}
}
}
@@ -1823,6 +1929,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitIdentifier(node: Identifier) {
if (convertedLoopState) {
if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) {
// in converted loop body arguments cannot be used directly.
let name = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments"));
write(name);
return;
}
}
if (!node.parent) {
write(node.text);
}
@@ -2765,7 +2880,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
* we we emit variable statement 'var' should be dropped.
*/
function isSourceFileLevelDeclarationInSystemJsModule(node: Node, isExported: boolean): boolean {
if (!node || languageVersion >= ScriptTarget.ES6 || !isCurrentFileSystemExternalModule()) {
if (!node || !isCurrentFileSystemExternalModule()) {
return false;
}
@@ -2785,7 +2900,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
/**
* Emit ES7 exponentiation operator downlevel using Math.pow
* @param node a binary expression node containing exponentiationOperator (**, **=)
* @param node a binary expression node containing exponentiationOperator (**, **=)
*/
function emitExponentiationOperator(node: BinaryExpression) {
let leftHandSideExpression = node.left;
@@ -2991,8 +3106,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitDoStatement(node: DoStatement) {
emitLoop(node, emitDoStatementWorker);
}
function emitDoStatementWorker(node: DoStatement, loop: ConvertedLoop) {
write("do");
emitEmbeddedStatement(node.statement);
if (loop) {
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
}
else {
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
}
if (node.statement.kind === SyntaxKind.Block) {
write(" ");
}
@@ -3005,10 +3129,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitWhileStatement(node: WhileStatement) {
emitLoop(node, emitWhileStatementWorker);
}
function emitWhileStatementWorker(node: WhileStatement, loop: ConvertedLoop) {
write("while (");
emit(node.expression);
write(")");
emitEmbeddedStatement(node.statement);
if (loop) {
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
}
else {
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
}
}
/**
@@ -3022,6 +3156,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return false;
}
if (convertedLoopState && (getCombinedNodeFlags(decl) & NodeFlags.BlockScoped) === 0) {
// we are inside a converted loop - this can only happen in downlevel scenarios
// record names for all variable declarations
for (const varDecl of decl.declarations) {
hoistVariableDeclarationFromLoop(convertedLoopState, varDecl);
}
return false;
}
let tokenKind = SyntaxKind.VarKeyword;
if (decl && languageVersion >= ScriptTarget.ES6) {
if (isLet(decl)) {
@@ -3073,7 +3216,295 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return started;
}
interface ConvertedLoop {
functionName: string;
paramList: string;
state: ConvertedLoopState;
}
function shouldConvertLoopBody(node: IterationStatement): boolean {
return languageVersion < ScriptTarget.ES6 &&
(resolver.getNodeCheckFlags(node) & NodeCheckFlags.LoopWithBlockScopedBindingCapturedInFunction) !== 0;
}
function emitLoop(node: IterationStatement, loopEmitter: (n: IterationStatement, convertedLoop: ConvertedLoop) => void): void {
const shouldConvert = shouldConvertLoopBody(node);
if (!shouldConvert) {
loopEmitter(node, /* convertedLoop*/ undefined);
}
else {
const loop = convertLoopBody(node);
if (node.parent.kind === SyntaxKind.LabeledStatement) {
// if parent of the loop was labeled statement - attach the label to loop skipping converted loop body
emitLabelAndColon(<LabeledStatement>node.parent);
}
loopEmitter(node, loop);
}
}
function convertLoopBody(node: IterationStatement): ConvertedLoop {
const functionName = makeUniqueName("_loop");
let loopInitializer: VariableDeclarationList;
switch (node.kind) {
case SyntaxKind.ForStatement:
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement:
if ((<ForStatement | ForInStatement | ForOfStatement>node).initializer.kind === SyntaxKind.VariableDeclarationList) {
loopInitializer = <VariableDeclarationList>(<ForStatement | ForInStatement | ForOfStatement>node).initializer;
}
break;
}
let loopParameters: string[];
if (loopInitializer && (getCombinedNodeFlags(loopInitializer) & NodeFlags.BlockScoped)) {
// if loop initializer contains block scoped variables - they should be passed to converted loop body as parameters
loopParameters = [];
for (const varDeclaration of loopInitializer.declarations) {
collectNames(varDeclaration.name);
}
}
const bodyIsBlock = node.statement.kind === SyntaxKind.Block;
const paramList = loopParameters ? loopParameters.join(", ") : "";
writeLine();
write(`var ${functionName} = function(${paramList})`);
if (!bodyIsBlock) {
write(" {");
writeLine();
increaseIndent();
}
const convertedOuterLoopState = convertedLoopState;
convertedLoopState = {};
if (convertedOuterLoopState) {
// convertedOuterLoopState !== undefined means that this converted loop is nested in another converted loop.
// if outer converted loop has already accumulated some state - pass it through
if (convertedOuterLoopState.argumentsName) {
// outer loop has already used 'arguments' so we've already have some name to alias it
// use the same name in all nested loops
convertedLoopState.argumentsName = convertedOuterLoopState.argumentsName;
}
if (convertedOuterLoopState.hoistedLocalVariables) {
// we've already collected some non-block scoped variable declarations in enclosing loop
// use the same storage in nested loop
convertedLoopState.hoistedLocalVariables = convertedOuterLoopState.hoistedLocalVariables;
}
}
emitEmbeddedStatement(node.statement);
if (!bodyIsBlock) {
decreaseIndent();
writeLine();
write("}");
}
write(";");
writeLine();
if (convertedLoopState.argumentsName) {
// if alias for arguments is set
if (convertedOuterLoopState) {
// pass it to outer converted loop
convertedOuterLoopState.argumentsName = convertedLoopState.argumentsName;
}
else {
// this is top level converted loop and we need to create an alias for 'arguments' object
write(`var ${convertedLoopState.argumentsName} = arguments;`);
writeLine();
}
}
if (convertedLoopState.hoistedLocalVariables) {
// if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later
if (convertedOuterLoopState) {
// pass them to outer converted loop
convertedOuterLoopState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables;
}
else {
// deduplicate and hoist collected variable declarations
write("var ");
let seen: Map<string>;
for (const id of convertedLoopState.hoistedLocalVariables) {
// Don't initialize seen unless we have at least one element.
// Emit a comma to separate for all but the first element.
if (!seen) {
seen = {};
}
else {
write(", ");
}
if (!hasProperty(seen, id.text)) {
emit(id);
seen[id.text] = id.text;
}
}
write(";");
writeLine();
}
}
const currentLoopState = convertedLoopState;
convertedLoopState = convertedOuterLoopState;
return { functionName, paramList, state: currentLoopState };
function collectNames(name: Identifier | BindingPattern): void {
if (name.kind === SyntaxKind.Identifier) {
const nameText = isNameOfNestedRedeclaration(<Identifier>name) ? getGeneratedNameForNode(name) : (<Identifier>name).text;
loopParameters.push(nameText);
}
else {
for (const element of (<BindingPattern>name).elements) {
collectNames(element.name);
}
}
}
}
function emitNormalLoopBody(node: IterationStatement, emitAsEmbeddedStatement: boolean): void {
let saveAllowedNonLabeledJumps: Jump;
if (convertedLoopState) {
// we get here if we are trying to emit normal loop loop inside converted loop
// set allowedNonLabeledJumps to Break | Continue to mark that break\continue inside the loop should be emitted as is
saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
convertedLoopState.allowedNonLabeledJumps = Jump.Break | Jump.Continue;
}
if (emitAsEmbeddedStatement) {
emitEmbeddedStatement(node.statement);
}
else if (node.statement.kind === SyntaxKind.Block) {
emitLines((<Block>node.statement).statements);
}
else {
writeLine();
emit(node.statement);
}
if (convertedLoopState) {
convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
}
}
function emitConvertedLoopCall(loop: ConvertedLoop, emitAsBlock: boolean): void {
if (emitAsBlock) {
write(" {");
writeLine();
increaseIndent();
}
// loop is considered simple if it does not have any return statements or break\continue that transfer control outside of the loop
// simple loops are emitted as just 'loop()';
const isSimpleLoop =
!loop.state.nonLocalJumps &&
!loop.state.labeledNonLocalBreaks &&
!loop.state.labeledNonLocalContinues;
const loopResult = makeUniqueName("state");
if (!isSimpleLoop) {
write(`var ${loopResult} = `);
}
write(`${loop.functionName}(${loop.paramList});`);
if (!isSimpleLoop) {
// for non simple loops we need to store result returned from converted loop function and use it to do dispatching
// converted loop function can return:
// - object - used when body of the converted loop contains return statement. Property "value" of this object stores retuned value
// - string - used to dispatch jumps. "break" and "continue" are used to non-labeled jumps, other values are used to transfer control to
// different labels
writeLine();
if (loop.state.nonLocalJumps & Jump.Return) {
write(`if (typeof ${loopResult} === "object") `);
if (convertedLoopState) {
// we are currently nested in another converted loop - return unwrapped result
write(`return ${loopResult};`);
// propagate 'hasReturn' flag to outer loop
convertedLoopState.nonLocalJumps |= Jump.Return;
}
else {
// top level converted loop - return unwrapped value
write(`return ${loopResult}.value`);
}
writeLine();
}
if (loop.state.nonLocalJumps & Jump.Break) {
write(`if (${loopResult} === "break") break;`);
writeLine();
}
if (loop.state.nonLocalJumps & Jump.Continue) {
write(`if (${loopResult} === "continue") continue;`);
writeLine();
}
// in case of labeled breaks emit code that either breaks to some known label inside outer loop or delegates jump decision to outer loop
emitDispatchTableForLabeledJumps(loopResult, loop.state, convertedLoopState);
}
if (emitAsBlock) {
writeLine();
decreaseIndent();
write("}");
}
function emitDispatchTableForLabeledJumps(loopResultVariable: string, currentLoop: ConvertedLoopState, outerLoop: ConvertedLoopState) {
if (!currentLoop.labeledNonLocalBreaks && !currentLoop.labeledNonLocalContinues) {
return;
}
write(`switch(${loopResultVariable}) {`);
increaseIndent();
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /* isBreak */ true, loopResultVariable, outerLoop);
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /* isBreak */ false, loopResultVariable, outerLoop);
decreaseIndent();
writeLine();
write("}");
}
function emitDispatchEntriesForLabeledJumps(table: Map<string>, isBreak: boolean, loopResultVariable: string, outerLoop: ConvertedLoopState): void {
if (!table) {
return;
}
for (let labelText in table) {
let labelMarker = table[labelText];
writeLine();
write(`case "${labelMarker}": `);
// if there are no outer converted loop or outer label in question is located inside outer converted loop
// then emit labeled break\continue
// otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do
if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) {
if (isBreak) {
write("break ");
}
else {
write("continue ");
}
write(`${labelText};`);
}
else {
setLabeledJump(outerLoop, isBreak, labelText, labelMarker);
write(`return ${loopResultVariable};`);
}
}
}
}
function emitForStatement(node: ForStatement) {
emitLoop(node, emitForStatementWorker);
}
function emitForStatementWorker(node: ForStatement, loop: ConvertedLoop) {
let endPos = emitToken(SyntaxKind.ForKeyword, node.pos);
write(" ");
endPos = emitToken(SyntaxKind.OpenParenToken, endPos);
@@ -3095,14 +3526,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write(";");
emitOptional(" ", node.incrementor);
write(")");
emitEmbeddedStatement(node.statement);
if (loop) {
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
}
else {
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
}
}
function emitForInOrForOfStatement(node: ForInStatement | ForOfStatement) {
if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.ForOfStatement) {
return emitDownLevelForOfStatement(node);
emitLoop(node, emitDownLevelForOfStatementWorker);
}
else {
emitLoop(node, emitForInOrForOfStatementWorker);
}
}
function emitForInOrForOfStatementWorker(node: ForInStatement | ForOfStatement, loop: ConvertedLoop) {
let endPos = emitToken(SyntaxKind.ForKeyword, node.pos);
write(" ");
endPos = emitToken(SyntaxKind.OpenParenToken, endPos);
@@ -3125,10 +3567,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
emit(node.expression);
emitToken(SyntaxKind.CloseParenToken, node.expression.end);
emitEmbeddedStatement(node.statement);
if (loop) {
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
}
else {
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
}
}
function emitDownLevelForOfStatement(node: ForOfStatement) {
emitLoop(node, emitDownLevelForOfStatementWorker);
}
function emitDownLevelForOfStatementWorker(node: ForOfStatement, loop: ConvertedLoop) {
// The following ES6 code:
//
// for (let v of expr) { }
@@ -3258,12 +3710,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitEnd(node.initializer);
write(";");
if (node.statement.kind === SyntaxKind.Block) {
emitLines((<Block>node.statement).statements);
if (loop) {
writeLine();
emitConvertedLoopCall(loop, /* emitAsBlock */ false);
}
else {
writeLine();
emit(node.statement);
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ false);
}
writeLine();
@@ -3272,12 +3724,63 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitBreakOrContinueStatement(node: BreakOrContinueStatement) {
if (convertedLoopState) {
// check if we can emit break\continue as is
// it is possible if either
// - break\continue is statement labeled and label is located inside the converted loop
// - break\continue is non-labeled and located in non-converted loop\switch statement
const jump = node.kind === SyntaxKind.BreakStatement ? Jump.Break : Jump.Continue;
const canUseBreakOrContinue =
(node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||
(!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
if (!canUseBreakOrContinue) {
if (!node.label) {
if (node.kind === SyntaxKind.BreakStatement) {
convertedLoopState.nonLocalJumps |= Jump.Break;
write(`return "break";`);
}
else {
convertedLoopState.nonLocalJumps |= Jump.Continue;
write(`return "continue";`);
}
}
else {
let labelMarker: string;
if (node.kind === SyntaxKind.BreakStatement) {
labelMarker = `break-${node.label.text}`;
setLabeledJump(convertedLoopState, /* isBreak */ true, node.label.text, labelMarker);
}
else {
labelMarker = `continue-${node.label.text}`;
setLabeledJump(convertedLoopState, /* isBreak */ false, node.label.text, labelMarker);
}
write(`return "${labelMarker}";`);
}
return;
}
}
emitToken(node.kind === SyntaxKind.BreakStatement ? SyntaxKind.BreakKeyword : SyntaxKind.ContinueKeyword, node.pos);
emitOptional(" ", node.label);
write(";");
}
function emitReturnStatement(node: ReturnStatement) {
if (convertedLoopState) {
convertedLoopState.nonLocalJumps |= Jump.Return;
write("return { value: ");
if (node.expression) {
emit(node.expression);
}
else {
write("void 0");
}
write(" };");
return;
}
emitToken(SyntaxKind.ReturnKeyword, node.pos);
emitOptional(" ", node.expression);
write(";");
@@ -3297,7 +3800,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emit(node.expression);
endPos = emitToken(SyntaxKind.CloseParenToken, node.expression.end);
write(" ");
let saveAllowedNonLabeledJumps: Jump;
if (convertedLoopState) {
saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
// for switch statement allow only non-labeled break
convertedLoopState.allowedNonLabeledJumps |= Jump.Break;
}
emitCaseBlock(node.caseBlock, endPos);
if (convertedLoopState) {
convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
}
}
function emitCaseBlock(node: CaseBlock, startPos: number): void {
@@ -3378,10 +3891,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write(";");
}
function emitLabelledStatement(node: LabeledStatement) {
function emitLabelAndColon(node: LabeledStatement): void {
emit(node.label);
write(": ");
}
function emitLabeledStatement(node: LabeledStatement) {
if (!isIterationStatement(node.statement, /* lookInLabeledStatements */ false) || !shouldConvertLoopBody(<IterationStatement>node.statement)) {
emitLabelAndColon(node);
}
if (convertedLoopState) {
if (!convertedLoopState.labels) {
convertedLoopState.labels = {};
}
convertedLoopState.labels[node.label.text] = node.label.text;
}
emit(node.statement);
if (convertedLoopState) {
convertedLoopState.labels[node.label.text] = undefined;
}
}
function getContainingModule(node: Node): ModuleDeclaration {
@@ -3815,12 +4346,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
// for (...) { var <some-uniqie-name> = void 0; }
// this is necessary to preserve ES6 semantic in scenarios like
// for (...) { let x; console.log(x); x = 1 } // assignment on one iteration should not affect other iterations
let isUninitializedLet =
let isLetDefinedInLoop =
(resolver.getNodeCheckFlags(node) & NodeCheckFlags.BlockScopedBindingInLoop) &&
(getCombinedFlagsForIdentifier(<Identifier>node.name) & NodeFlags.Let);
// NOTE: default initialization should not be added to let bindings in for-in\for-of statements
if (isUninitializedLet &&
if (isLetDefinedInLoop &&
node.parent.parent.kind !== SyntaxKind.ForInStatement &&
node.parent.parent.kind !== SyntaxKind.ForOfStatement) {
initializer = createVoidZero();
@@ -4303,9 +4834,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitSignatureAndBody(node: FunctionLikeDeclaration) {
const saveConvertedLoopState = convertedLoopState;
let saveTempFlags = tempFlags;
let saveTempVariables = tempVariables;
let saveTempParameters = tempParameters;
convertedLoopState = undefined;
tempFlags = 0;
tempVariables = undefined;
tempParameters = undefined;
@@ -4331,6 +4865,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitExportMemberAssignment(node);
}
Debug.assert(convertedLoopState === undefined);
convertedLoopState = saveConvertedLoopState;
tempFlags = saveTempFlags;
tempVariables = saveTempVariables;
tempParameters = saveTempParameters;
@@ -4652,15 +5189,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitConstructor(node: ClassLikeDeclaration, baseTypeElement: ExpressionWithTypeArguments) {
const saveConvertedLoopState = convertedLoopState;
let saveTempFlags = tempFlags;
let saveTempVariables = tempVariables;
let saveTempParameters = tempParameters;
convertedLoopState = undefined;
tempFlags = 0;
tempVariables = undefined;
tempParameters = undefined;
emitConstructorWorker(node, baseTypeElement);
Debug.assert(convertedLoopState === undefined);
convertedLoopState = saveConvertedLoopState;
tempFlags = saveTempFlags;
tempVariables = saveTempVariables;
tempParameters = saveTempParameters;
@@ -4998,6 +5541,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
let saveTempVariables = tempVariables;
let saveTempParameters = tempParameters;
let saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames;
let saveConvertedLoopState = convertedLoopState;
convertedLoopState = undefined;
tempFlags = 0;
tempVariables = undefined;
tempParameters = undefined;
@@ -5025,6 +5571,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
});
write(";");
emitTempDeclarations(/*newLine*/ true);
Debug.assert(convertedLoopState === undefined);
convertedLoopState = saveConvertedLoopState;
tempFlags = saveTempFlags;
tempVariables = saveTempVariables;
tempParameters = saveTempParameters;
@@ -5706,13 +6256,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitEnd(node.name);
write(") ");
if (node.body.kind === SyntaxKind.ModuleBlock) {
const saveConvertedLoopState = convertedLoopState;
let saveTempFlags = tempFlags;
let saveTempVariables = tempVariables;
convertedLoopState = undefined;
tempFlags = 0;
tempVariables = undefined;
emit(node.body);
Debug.assert(convertedLoopState === undefined);
convertedLoopState = saveConvertedLoopState;
tempFlags = saveTempFlags;
tempVariables = saveTempVariables;
}
@@ -7247,7 +7802,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return emitTemplateSpan(<TemplateSpan>node);
case SyntaxKind.JsxElement:
case SyntaxKind.JsxSelfClosingElement:
return emitJsxElement(<JsxElement|JsxSelfClosingElement>node);
return emitJsxElement(<JsxElement | JsxSelfClosingElement>node);
case SyntaxKind.JsxText:
return emitJsxText(<JsxText>node);
case SyntaxKind.JsxExpression:
@@ -7345,7 +7900,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
case SyntaxKind.DefaultClause:
return emitCaseOrDefaultClause(<CaseOrDefaultClause>node);
case SyntaxKind.LabeledStatement:
return emitLabelledStatement(<LabeledStatement>node);
return emitLabeledStatement(<LabeledStatement>node);
case SyntaxKind.ThrowStatement:
return emitThrowStatement(<ThrowStatement>node);
case SyntaxKind.TryStatement:
+32 -12
View File
@@ -2,15 +2,15 @@
/// <reference path="utilities.ts"/>
namespace ts {
let nodeConstructors = new Array<new () => Node>(SyntaxKind.Count);
let nodeConstructors = new Array<new (pos: number, end: number) => Node>(SyntaxKind.Count);
/* @internal */ export let parseTime = 0;
export function getNodeConstructor(kind: SyntaxKind): new () => Node {
export function getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node {
return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind));
}
export function createNode(kind: SyntaxKind): Node {
return new (getNodeConstructor(kind))();
export function createNode(kind: SyntaxKind, pos?: number, end?: number): Node {
return new (getNodeConstructor(kind))(pos, end);
}
function visitNode<T>(cbNode: (node: Node) => T, node: Node): T {
@@ -993,14 +993,10 @@ namespace ts {
function createNode(kind: SyntaxKind, pos?: number): Node {
nodeCount++;
let node = new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))();
if (!(pos >= 0)) {
pos = scanner.getStartPos();
}
node.pos = pos;
node.end = pos;
return node;
return new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(pos, pos);
}
function finishNode<T extends Node>(node: T, end?: number): T {
@@ -3454,19 +3450,43 @@ namespace ts {
function parseJsxElementOrSelfClosingElement(inExpressionContext: boolean): JsxElement | JsxSelfClosingElement {
let opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
let result: JsxElement | JsxSelfClosingElement;
if (opening.kind === SyntaxKind.JsxOpeningElement) {
let node = <JsxElement>createNode(SyntaxKind.JsxElement, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement.tagName);
node.closingElement = parseJsxClosingElement(inExpressionContext);
return finishNode(node);
result = finishNode(node);
}
else {
Debug.assert(opening.kind === SyntaxKind.JsxSelfClosingElement);
// Nothing else to do for self-closing elements
return <JsxSelfClosingElement>opening;
result = <JsxSelfClosingElement>opening;
}
// If the user writes the invalid code '<div></div><div></div>' in an expression context (i.e. not wrapped in
// an enclosing tag), we'll naively try to parse ^ this as a 'less than' operator and the remainder of the tag
// as garbage, which will cause the formatter to badly mangle the JSX. Perform a speculative parse of a JSX
// element if we see a < token so that we can wrap it in a synthetic binary expression so the formatter
// does less damage and we can report a better error.
// Since JSX elements are invalid < operands anyway, this lookahead parse will only occur in error scenarios
// of one sort or another.
if (inExpressionContext && token === SyntaxKind.LessThanToken) {
let invalidElement = tryParse(() => parseJsxElementOrSelfClosingElement(/*inExpressionContext*/true));
if (invalidElement) {
parseErrorAtCurrentToken(Diagnostics.JSX_expressions_must_have_one_parent_element);
let badNode = <BinaryExpression>createNode(SyntaxKind.BinaryExpression, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
badNode.operatorToken = createMissingNode(SyntaxKind.CommaToken, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return <JsxElement><Node>badNode;
}
}
return result;
}
function parseJsxText(): JsxText {
@@ -3512,7 +3532,7 @@ namespace ts {
return result;
}
function parseJsxOpeningOrSelfClosingElement(inExpressionContext: boolean): JsxOpeningElement|JsxSelfClosingElement {
function parseJsxOpeningOrSelfClosingElement(inExpressionContext: boolean): JsxOpeningElement | JsxSelfClosingElement {
let fullStart = scanner.getStartPos();
parseExpected(SyntaxKind.LessThanToken);
+3 -7
View File
@@ -12,7 +12,7 @@ namespace ts {
let emptyArray: any[] = [];
export const version = "1.7.0";
export const version = "1.8.0";
export function findConfigFile(searchPath: string): string {
let fileName = "tsconfig.json";
@@ -863,10 +863,6 @@ namespace ts {
let start = getTokenPosOfNode(file.imports[i], file);
fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName));
}
else if (!fileExtensionIs(importedFile.fileName, ".d.ts")) {
let start = getTokenPosOfNode(file.imports[i], file);
fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_can_only_be_in_d_ts_files_Please_contact_the_package_author_to_update_the_package_definition));
}
else if (importedFile.referencedFiles.length) {
let firstRef = importedFile.referencedFiles[0];
fileProcessingDiagnostics.add(createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, Diagnostics.Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition));
@@ -1005,7 +1001,7 @@ namespace ts {
let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
if (options.isolatedModules) {
if (!options.module && languageVersion < ScriptTarget.ES6) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher));
}
let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
@@ -1022,7 +1018,7 @@ namespace ts {
// Cannot specify module gen target of es6 when below es6
if (options.module === ModuleKind.ES6 && languageVersion < ScriptTarget.ES6) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es6_when_targeting_ES5_or_lower));
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
}
// there has to be common source directory if user specified --outdir || --sourceRoot
+1 -1
View File
@@ -407,7 +407,7 @@ namespace ts {
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
return _fs.watch(
path,
{ persisten: true, recursive: !!recursive },
{ persistent: true, recursive: !!recursive },
(eventName: string, relativeFileName: string) => {
// In watchDirectory we only care about adding and removing files (when event name is
// "rename"); changes made within files are handled by corresponding fileWatchers (when
+21 -2
View File
@@ -159,6 +159,11 @@ namespace ts {
let timerHandleForRecompilation: number; // Handle for 0.25s wait timer to trigger recompilation
let timerHandleForDirectoryChanges: number; // Handle for 0.25s wait timer to trigger directory change handler
// This map stores and reuses results of fileExists check that happen inside 'createProgram'
// This allows to save time in module resolution heavy scenarios when existence of the same file might be checked multiple times.
let cachedExistingFiles: Map<boolean>;
let hostFileExists: typeof compilerHost.fileExists;
if (commandLine.options.locale) {
if (!isJSONSupported()) {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--locale"));
@@ -274,8 +279,14 @@ namespace ts {
compilerHost = createCompilerHost(compilerOptions);
hostGetSourceFile = compilerHost.getSourceFile;
compilerHost.getSourceFile = getSourceFile;
hostFileExists = compilerHost.fileExists;
compilerHost.fileExists = cachedFileExists;
}
// reset the cache of existing files
cachedExistingFiles = {};
let compileResult = compile(rootFileNames, compilerOptions, compilerHost);
if (!compilerOptions.watch) {
@@ -286,6 +297,13 @@ namespace ts {
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes));
}
function cachedFileExists(fileName: string): boolean {
if (hasProperty(cachedExistingFiles, fileName)) {
return cachedExistingFiles[fileName];
}
return cachedExistingFiles[fileName] = hostFileExists(fileName);
}
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) {
// Return existing SourceFile object if one is available
if (cachedProgram) {
@@ -360,7 +378,8 @@ namespace ts {
let newFileNames = ts.map(parsedCommandLine.fileNames, compilerHost.getCanonicalFileName);
let canonicalRootFileNames = ts.map(rootFileNames, compilerHost.getCanonicalFileName);
if (!arrayStructurallyIsEqualTo(newFileNames, canonicalRootFileNames)) {
// We check if the project file list has changed. If so, we just throw away the old program and start fresh.
if (!arrayIsEqualTo(newFileNames && newFileNames.sort(), canonicalRootFileNames && canonicalRootFileNames.sort())) {
setCachedProgram(undefined);
startTimerForRecompilation();
}
@@ -566,7 +585,7 @@ namespace ts {
function writeConfigFile(options: CompilerOptions, fileNames: string[]) {
let currentDirectory = sys.getCurrentDirectory();
let file = combinePaths(currentDirectory, "tsconfig.json");
let file = normalizePath(combinePaths(currentDirectory, "tsconfig.json"));
if (sys.fileExists(file)) {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file));
}
+6 -2
View File
@@ -361,6 +361,7 @@ namespace ts {
}
export const enum NodeFlags {
None = 0,
Export = 0x00000001, // Declarations
Ambient = 0x00000002, // Declarations
Public = 0x00000010, // Property/Method
@@ -1305,7 +1306,7 @@ namespace ts {
getCurrentDirectory(): string;
}
export interface ParseConfigHost extends ModuleResolutionHost {
export interface ParseConfigHost {
readDirectory(rootDir: string, extension: string, exclude: string[]): string[];
}
@@ -1612,6 +1613,7 @@ namespace ts {
getTypeReferenceSerializationKind(typeName: EntityName): TypeReferenceSerializationKind;
isOptionalParameter(node: ParameterDeclaration): boolean;
moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean;
isArgumentsLocalBinding(node: Identifier): boolean;
}
export const enum SymbolFlags {
@@ -1757,7 +1759,8 @@ namespace ts {
// Values for enum members have been computed, and any errors have been reported for them.
EnumValuesComputed = 0x00002000,
BlockScopedBindingInLoop = 0x00004000,
LexicalModuleMergesWithClass= 0x00008000, // Instantiated lexical module declaration is merged with a previous class declaration.
LexicalModuleMergesWithClass = 0x00008000, // Instantiated lexical module declaration is merged with a previous class declaration.
LoopWithBlockScopedBindingCapturedInFunction = 0x00010000, // Loop that contains block scoped variable captured in closure
}
/* @internal */
@@ -2014,6 +2017,7 @@ namespace ts {
key: string;
category: DiagnosticCategory;
code: number;
message: string;
}
/**
+23 -19
View File
@@ -82,17 +82,17 @@ namespace ts {
return node.end - node.pos;
}
export function arrayIsEqualTo<T>(arr1: T[], arr2: T[], comparer?: (a: T, b: T) => boolean): boolean {
if (!arr1 || !arr2) {
return arr1 === arr2;
export function arrayIsEqualTo<T>(array1: T[], array2: T[], equaler?: (a: T, b: T) => boolean): boolean {
if (!array1 || !array2) {
return array1 === array2;
}
if (arr1.length !== arr2.length) {
if (array1.length !== array2.length) {
return false;
}
for (let i = 0; i < arr1.length; ++i) {
let equals = comparer ? comparer(arr1[i], arr2[i]) : arr1[i] === arr2[i];
for (let i = 0; i < array1.length; ++i) {
let equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i];
if (!equals) {
return false;
}
@@ -657,6 +657,22 @@ namespace ts {
return false;
}
export function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean {
switch (node.kind) {
case SyntaxKind.ForStatement:
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement:
case SyntaxKind.DoStatement:
case SyntaxKind.WhileStatement:
return true;
case SyntaxKind.LabeledStatement:
return lookInLabeledStatements && isIterationStatement((<LabeledStatement>node).statement, lookInLabeledStatements);
}
return false;
}
export function isFunctionBlock(node: Node) {
return node && node.kind === SyntaxKind.Block && isFunctionLike(node.parent);
}
@@ -1505,7 +1521,7 @@ namespace ts {
}
export function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node {
let node = <SynthesizedNode>createNode(kind);
let node = <SynthesizedNode>createNode(kind, /* pos */ -1, /* end */ -1);
node.startsOnNewLine = startsOnNewLine;
return node;
}
@@ -2414,16 +2430,4 @@ namespace ts {
}
}
}
export function arrayStructurallyIsEqualTo<T>(array1: Array<T>, array2: Array<T>): boolean {
if (!array1 || !array2) {
return false;
}
if (array1.length !== array2.length) {
return false;
}
return arrayIsEqualTo(array1.sort(), array2.sort());
}
}
+3 -1
View File
@@ -274,7 +274,9 @@ namespace Utils {
case "flags":
// Print out flags with their enum names.
o[propertyName] = getNodeFlagName(n.flags);
if (n.flags) {
o[propertyName] = getNodeFlagName(n.flags);
}
break;
case "parserContextFlags":
+1 -1
View File
@@ -1210,7 +1210,7 @@ interface ArrayBuffer {
interface ArrayBufferConstructor {
prototype: ArrayBuffer;
new (byteLength: number): ArrayBuffer;
isView(arg: any): boolean;
isView(arg: any): arg is ArrayBufferView;
}
declare var ArrayBuffer: ArrayBufferConstructor;
+63 -3
View File
@@ -2193,6 +2193,68 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement;
createElement(tagName: "xmp"): HTMLBlockElement;
createElement(tagName: string): HTMLElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
createElementNS(namespaceURI: string, qualifiedName: string): Element;
createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
createNSResolver(nodeResolver: Node): XPathNSResolver;
@@ -7014,14 +7076,12 @@ interface ImageData {
width: number;
}
interface ImageDataConstructor {
declare var ImageData: {
prototype: ImageData;
new(width: number, height: number): ImageData;
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
}
declare var ImageData: ImageDataConstructor;
interface KeyboardEvent extends UIEvent {
altKey: boolean;
char: string;
+1 -3
View File
@@ -465,14 +465,12 @@ interface ImageData {
width: number;
}
interface ImageDataConstructor {
declare var ImageData: {
prototype: ImageData;
new(width: number, height: number): ImageData;
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
}
declare var ImageData: ImageDataConstructor;
interface MSApp {
clearTemporaryWebDataAsync(): MSAppAsyncOperation;
createBlobFromRandomAccessStream(type: string, seeker: any): Blob;
+6 -1
View File
@@ -576,7 +576,8 @@ namespace ts.server {
let newRootFiles = projectOptions.files.map((f => this.getCanonicalFileName(f)));
let currentRootFiles = project.getRootFiles().map((f => this.getCanonicalFileName(f)));
if (!arrayStructurallyIsEqualTo(currentRootFiles, newRootFiles)) {
// We check if the project file list has changed. If so, we update the project.
if (!arrayIsEqualTo(currentRootFiles && currentRootFiles.sort(), newRootFiles && newRootFiles.sort())) {
// For configured projects, the change is made outside the tsconfig file, and
// it is not likely to affect the project for other files opened by the client. We can
// just update the current project.
@@ -1267,11 +1268,15 @@ namespace ts.server {
if (info.isOpen) {
if (this.openFileRoots.indexOf(info) >= 0) {
this.openFileRoots = copyListRemovingItem(info, this.openFileRoots);
if (info.defaultProject && !info.defaultProject.isConfiguredProject()) {
this.removeProject(info.defaultProject);
}
}
if (this.openFilesReferenced.indexOf(info) >= 0) {
this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced);
}
this.openFileRootsConfigured.push(info);
info.defaultProject = project;
}
}
project.addRoot(info);
+27 -5
View File
@@ -11,7 +11,7 @@ namespace ts.server {
input: process.stdin,
output: process.stdout,
terminal: false,
});
});
class Logger implements ts.server.Logger {
fd = -1;
@@ -58,7 +58,7 @@ namespace ts.server {
isVerbose() {
return this.loggingEnabled() && (this.level == "verbose");
}
msg(s: string, type = "Err") {
if (this.fd < 0) {
@@ -89,18 +89,18 @@ namespace ts.server {
}
exit() {
this.projectService.log("Exiting...","Info");
this.projectService.log("Exiting...", "Info");
this.projectService.closeLog();
process.exit(0);
}
listen() {
rl.on('line',(input: string) => {
rl.on('line', (input: string) => {
var message = input.trim();
this.onMessage(message);
});
rl.on('close',() => {
rl.on('close', () => {
this.exit();
});
}
@@ -155,6 +155,28 @@ namespace ts.server {
var logger = createLoggerFromEnv();
let pending: string[] = [];
let canWrite = true;
function writeMessage(s: string) {
if (!canWrite) {
pending.push(s);
}
else {
canWrite = false;
process.stdout.write(new Buffer(s, "utf8"), setCanWriteFlagAndWriteMessageIfNecessary);
}
}
function setCanWriteFlagAndWriteMessageIfNecessary() {
canWrite = true;
if (pending.length) {
writeMessage(pending.shift());
}
}
// Override sys.write because fs.writeSync is not reliable on Node 4
ts.sys.write = (s: string) => writeMessage(s);
var ioSession = new IOSession(ts.sys, logger);
process.on('uncaughtException', function(err: Error) {
ioSession.logError(err, "unknown");
+5 -3
View File
@@ -695,8 +695,8 @@ namespace ts.formatting {
let tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos);
if (isTokenInRange) {
let rangeHasError = rangeContainsError(currentTokenInfo.token);
// save prevStartLine since processRange will overwrite this value with current ones
let prevStartLine = previousRangeStartLine;
// save previousRange since processRange will overwrite this value with current one
let savePreviousRange = previousRange;
lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation);
if (rangeHasError) {
// do not indent comments\token if token range overlaps with some error
@@ -707,7 +707,9 @@ namespace ts.formatting {
indentToken = lineAdded;
}
else {
indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine;
// indent token only if end line of previous range does not match start line of the token
const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line;
indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine;
}
}
}
+8 -10
View File
@@ -174,9 +174,7 @@ namespace ts {
let jsDocCompletionEntries: CompletionEntry[];
function createNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags, parent?: Node): NodeObject {
let node = <NodeObject> new (getNodeConstructor(kind))();
node.pos = pos;
node.end = end;
let node = <NodeObject> new (getNodeConstructor(kind))(pos, end);
node.flags = flags;
node.parent = parent;
return node;
@@ -7362,7 +7360,7 @@ namespace ts {
let sourceFile = current.getSourceFile();
var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName));
if (sourceFile && getCanonicalFileName(ts.normalizePath(sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key));
return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library));
}
}
}
@@ -7384,7 +7382,7 @@ namespace ts {
}
}
return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element.key));
return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element));
function getRenameInfoError(localizedErrorMessage: string): RenameInfo {
return {
@@ -7967,14 +7965,14 @@ namespace ts {
function initializeServices() {
objectAllocator = {
getNodeConstructor: kind => {
function Node() {
function Node(pos: number, end: number) {
this.pos = pos;
this.end = end;
this.flags = NodeFlags.None;
this.parent = undefined;
}
let proto = kind === SyntaxKind.SourceFile ? new SourceFileObject() : new NodeObject();
proto.kind = kind;
proto.pos = -1;
proto.end = -1;
proto.flags = 0;
proto.parent = undefined;
Node.prototype = proto;
return <any>Node;
},
@@ -0,0 +1,12 @@
//// [ambientClassMergesOverloadsWithInterface.ts]
declare class C {
baz(): any;
foo(n: number): any;
}
interface C {
foo(n: number): any;
bar(): any;
}
//// [ambientClassMergesOverloadsWithInterface.js]
@@ -0,0 +1,22 @@
=== tests/cases/compiler/ambientClassMergesOverloadsWithInterface.ts ===
declare class C {
>C : Symbol(C, Decl(ambientClassMergesOverloadsWithInterface.ts, 0, 0), Decl(ambientClassMergesOverloadsWithInterface.ts, 3, 1))
baz(): any;
>baz : Symbol(baz, Decl(ambientClassMergesOverloadsWithInterface.ts, 0, 17))
foo(n: number): any;
>foo : Symbol(foo, Decl(ambientClassMergesOverloadsWithInterface.ts, 1, 15), Decl(ambientClassMergesOverloadsWithInterface.ts, 4, 13))
>n : Symbol(n, Decl(ambientClassMergesOverloadsWithInterface.ts, 2, 8))
}
interface C {
>C : Symbol(C, Decl(ambientClassMergesOverloadsWithInterface.ts, 0, 0), Decl(ambientClassMergesOverloadsWithInterface.ts, 3, 1))
foo(n: number): any;
>foo : Symbol(foo, Decl(ambientClassMergesOverloadsWithInterface.ts, 1, 15), Decl(ambientClassMergesOverloadsWithInterface.ts, 4, 13))
>n : Symbol(n, Decl(ambientClassMergesOverloadsWithInterface.ts, 5, 8))
bar(): any;
>bar : Symbol(bar, Decl(ambientClassMergesOverloadsWithInterface.ts, 5, 24))
}
@@ -0,0 +1,22 @@
=== tests/cases/compiler/ambientClassMergesOverloadsWithInterface.ts ===
declare class C {
>C : C
baz(): any;
>baz : () => any
foo(n: number): any;
>foo : { (n: number): any; (n: number): any; }
>n : number
}
interface C {
>C : C
foo(n: number): any;
>foo : { (n: number): any; (n: number): any; }
>n : number
bar(): any;
>bar : () => any
}
@@ -0,0 +1,13 @@
//// [arrayBufferIsViewNarrowsType.ts]
var obj: Object;
if (ArrayBuffer.isView(obj)) {
// isView should be a guard that narrows type to ArrayBufferView.
var ab: ArrayBufferView = obj;
}
//// [arrayBufferIsViewNarrowsType.js]
var obj;
if (ArrayBuffer.isView(obj)) {
// isView should be a guard that narrows type to ArrayBufferView.
var ab = obj;
}
@@ -0,0 +1,17 @@
=== tests/cases/compiler/arrayBufferIsViewNarrowsType.ts ===
var obj: Object;
>obj : Symbol(obj, Decl(arrayBufferIsViewNarrowsType.ts, 0, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
if (ArrayBuffer.isView(obj)) {
>ArrayBuffer.isView : Symbol(ArrayBufferConstructor.isView, Decl(lib.d.ts, --, --))
>ArrayBuffer : Symbol(ArrayBuffer, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>isView : Symbol(ArrayBufferConstructor.isView, Decl(lib.d.ts, --, --))
>obj : Symbol(obj, Decl(arrayBufferIsViewNarrowsType.ts, 0, 3))
// isView should be a guard that narrows type to ArrayBufferView.
var ab: ArrayBufferView = obj;
>ab : Symbol(ab, Decl(arrayBufferIsViewNarrowsType.ts, 3, 7))
>ArrayBufferView : Symbol(ArrayBufferView, Decl(lib.d.ts, --, --))
>obj : Symbol(obj, Decl(arrayBufferIsViewNarrowsType.ts, 0, 3))
}
@@ -0,0 +1,18 @@
=== tests/cases/compiler/arrayBufferIsViewNarrowsType.ts ===
var obj: Object;
>obj : Object
>Object : Object
if (ArrayBuffer.isView(obj)) {
>ArrayBuffer.isView(obj) : boolean
>ArrayBuffer.isView : (arg: any) => arg is ArrayBufferView
>ArrayBuffer : ArrayBufferConstructor
>isView : (arg: any) => arg is ArrayBufferView
>obj : Object
// isView should be a guard that narrows type to ArrayBufferView.
var ab: ArrayBufferView = obj;
>ab : ArrayBufferView
>ArrayBufferView : ArrayBufferView
>obj : ArrayBufferView
}
@@ -2,9 +2,13 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: st
Property 'one' is missing in type '{ [index: string]: any; }'.
tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
Property 'one' is missing in type '{ [index: number]: any; }'.
tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'.
Index signature is missing in type 'String'.
tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'.
Index signature is missing in type 'Boolean'.
==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ====
==== tests/cases/compiler/assignmentCompat1.ts (4 errors) ====
var x = { one: 1 };
var y: { [index: string]: any };
var z: { [index: number]: any };
@@ -18,4 +22,14 @@ tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: nu
!!! error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
!!! error TS2322: Property 'one' is missing in type '{ [index: number]: any; }'.
z = x; // Ok because index signature type is any
y = "foo"; // Error
~
!!! error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'.
!!! error TS2322: Index signature is missing in type 'String'.
z = "foo"; // OK, string has numeric indexer
z = false; // Error
~
!!! error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'.
!!! error TS2322: Index signature is missing in type 'Boolean'.
@@ -6,6 +6,10 @@ x = y; // Error
y = x; // Ok because index signature type is any
x = z; // Error
z = x; // Ok because index signature type is any
y = "foo"; // Error
z = "foo"; // OK, string has numeric indexer
z = false; // Error
//// [assignmentCompat1.js]
@@ -16,3 +20,6 @@ x = y; // Error
y = x; // Ok because index signature type is any
x = z; // Error
z = x; // Ok because index signature type is any
y = "foo"; // Error
z = "foo"; // OK, string has numeric indexer
z = false; // Error
@@ -1,24 +1,18 @@
tests/cases/compiler/augmentedTypesClass2.ts(4,7): error TS2518: Only an ambient class can be merged with an interface.
tests/cases/compiler/augmentedTypesClass2.ts(10,11): error TS2518: Only an ambient class can be merged with an interface.
tests/cases/compiler/augmentedTypesClass2.ts(16,7): error TS2300: Duplicate identifier 'c33'.
tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate identifier 'c33'.
==== tests/cases/compiler/augmentedTypesClass2.ts (4 errors) ====
==== tests/cases/compiler/augmentedTypesClass2.ts (2 errors) ====
// Checking class with other things in type space not value space
// class then interface
class c11 { // error
~~~
!!! error TS2518: Only an ambient class can be merged with an interface.
class c11 {
foo() {
return 1;
}
}
interface c11 { // error
~~~
!!! error TS2518: Only an ambient class can be merged with an interface.
interface c11 {
bar(): void;
}
@@ -2,13 +2,13 @@
// Checking class with other things in type space not value space
// class then interface
class c11 { // error
class c11 {
foo() {
return 1;
}
}
interface c11 { // error
interface c11 {
bar(): void;
}
@@ -1,10 +1,8 @@
tests/cases/compiler/augmentedTypesInterface.ts(12,11): error TS2518: Only an ambient class can be merged with an interface.
tests/cases/compiler/augmentedTypesInterface.ts(16,7): error TS2518: Only an ambient class can be merged with an interface.
tests/cases/compiler/augmentedTypesInterface.ts(23,11): error TS2300: Duplicate identifier 'i3'.
tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate identifier 'i3'.
==== tests/cases/compiler/augmentedTypesInterface.ts (4 errors) ====
==== tests/cases/compiler/augmentedTypesInterface.ts (2 errors) ====
// interface then interface
interface i {
@@ -16,15 +14,11 @@ tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate i
}
// interface then class
interface i2 { // error
~~
!!! error TS2518: Only an ambient class can be merged with an interface.
interface i2 {
foo(): void;
}
class i2 { // error
~~
!!! error TS2518: Only an ambient class can be merged with an interface.
class i2 {
bar() {
return 1;
}
@@ -10,11 +10,11 @@ interface i {
}
// interface then class
interface i2 { // error
interface i2 {
foo(): void;
}
class i2 { // error
class i2 {
bar() {
return 1;
}
@@ -0,0 +1,12 @@
tests/cases/compiler/bindingPatternInParameter01.ts(4,3): error TS2304: Cannot find name 'console'.
==== tests/cases/compiler/bindingPatternInParameter01.ts (1 errors) ====
const nestedArray = [[[1, 2]], [[3, 4]]];
nestedArray.forEach(([[a, b]]) => {
console.log(a, b);
~~~~~~~
!!! error TS2304: Cannot find name 'console'.
});
@@ -0,0 +1,14 @@
//// [bindingPatternInParameter01.ts]
const nestedArray = [[[1, 2]], [[3, 4]]];
nestedArray.forEach(([[a, b]]) => {
console.log(a, b);
});
//// [bindingPatternInParameter01.js]
var nestedArray = [[[1, 2]], [[3, 4]]];
nestedArray.forEach(function (_a) {
var _b = _a[0], a = _b[0], b = _b[1];
console.log(a, b);
});
@@ -0,0 +1,272 @@
//// [capturedLetConstInLoop1.ts]
//==== let
for (let x in {}) {
(function() { return x});
(() => x);
}
for (let x of []) {
(function() { return x});
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
}
do {
let x;
(function() { return x});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
}
//=========const
for (const x in {}) {
(function() { return x});
(() => x);
}
for (const x of []) {
(function() { return x});
(() => x);
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
}
do {
const x = 1;
(function() { return x});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
}
//// [capturedLetConstInLoop1.js]
//==== let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x in {}) {
_loop_1(x);
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
_loop_2(x);
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x = 0; x < 1; ++x) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
};
while (1 === 1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
};
do {
_loop_5();
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
};
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1; ++x) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
};
do {
_loop_9();
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
};
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
//=========const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x in {}) {
_loop_11(x);
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
_loop_12(x);
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x = 0; x < 1;) {
_loop_13(x);
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
};
while (1 === 1) {
_loop_14();
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
};
do {
_loop_15();
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
};
for (var y = 0; y < 1;) {
_loop_16(y);
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1;) {
_loop_17(x, y);
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_18();
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
};
do {
_loop_19();
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
};
for (var y = 0; y < 1;) {
_loop_20(y);
}
@@ -0,0 +1,260 @@
=== tests/cases/compiler/capturedLetConstInLoop1.ts ===
//==== let
for (let x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
}
//=========const
for (const x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
}
@@ -0,0 +1,428 @@
=== tests/cases/compiler/capturedLetConstInLoop1.ts ===
//==== let
for (let x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//=========const
for (const x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
@@ -0,0 +1,210 @@
//// [capturedLetConstInLoop1_ES6.ts]
//==== let
for (let x in {}) {
(function() { return x});
(() => x);
}
for (let x of []) {
(function() { return x});
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
}
do {
let x;
(function() { return x});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
}
//=========const
for (const x in {}) {
(function() { return x});
(() => x);
}
for (const x of []) {
(function() { return x});
(() => x);
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
}
do {
const x = 1;
(function() { return x});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
}
//// [capturedLetConstInLoop1_ES6.js]
//==== let
for (let x in {}) {
(function () { return x; });
(() => x);
}
for (let x of []) {
(function () { return x; });
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
}
while (1 === 1) {
let x;
(function () { return x; });
(() => x);
}
do {
let x;
(function () { return x; });
(() => x);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
}
while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
}
do {
let x, y;
(function () { return x + y; });
(() => x + y);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
}
//=========const
for (const x in {}) {
(function () { return x; });
(() => x);
}
for (const x of []) {
(function () { return x; });
(() => x);
}
for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
}
while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
}
do {
const x = 1;
(function () { return x; });
(() => x);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
}
do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
}
@@ -0,0 +1,260 @@
=== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts ===
//==== let
for (let x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
}
//=========const
for (const x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 85, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 85, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
}
@@ -0,0 +1,428 @@
=== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts ===
//==== let
for (let x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//=========const
for (const x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
@@ -0,0 +1,413 @@
//// [capturedLetConstInLoop2.ts]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y =1 ;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
//// [capturedLetConstInLoop2.js]
// ========let
function foo0(x) {
var _loop_1 = function(x_1) {
var a = arguments_1.length;
(function () { return x_1 + a; });
(function () { return x_1 + a; });
};
var arguments_1 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
_loop_1(x_1);
}
}
function foo0_1(x) {
var _loop_2 = function(x_2) {
var a = arguments_2.length;
(function () { return x_2 + a; });
(function () { return x_2 + a; });
};
var arguments_2 = arguments;
for (var x_2 in []) {
_loop_2(x_2);
}
}
function foo1(x) {
var _loop_3 = function(x_3) {
var a = arguments_3.length;
(function () { return x_3 + a; });
(function () { return x_3 + a; });
};
var arguments_3 = arguments;
for (var x_3 = 0; x_3 < 1; ++x_3) {
_loop_3(x_3);
}
}
function foo2(x) {
var _loop_4 = function() {
var a = arguments_4.length;
(function () { return x + a; });
(function () { return x + a; });
};
var arguments_4 = arguments;
while (1 === 1) {
_loop_4();
}
}
function foo3(x) {
var _loop_5 = function() {
var x_4 = void 0;
var a = arguments_5.length;
(function () { return x_4 + a; });
(function () { return x_4 + a; });
};
var arguments_5 = arguments;
do {
_loop_5();
} while (1 === 1);
}
function foo4(x) {
var _loop_6 = function(y) {
var a = arguments_6.length;
var x_5 = 1;
(function () { return x_5 + a; });
(function () { return x_5 + a; });
};
var arguments_6 = arguments;
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
}
function foo5(x) {
var _loop_7 = function(x_6, y) {
var a = arguments_7.length;
(function () { return x_6 + y + a; });
(function () { return x_6 + y + a; });
};
var arguments_7 = arguments;
for (var x_6 = 0, y = 1; x_6 < 1; ++x_6) {
_loop_7(x_6, y);
}
}
function foo6(x) {
var _loop_8 = function() {
var x_7 = void 0, y = void 0;
var a = arguments_8.length;
(function () { return x_7 + y + a; });
(function () { return x_7 + y + a; });
};
var arguments_8 = arguments;
while (1 === 1) {
_loop_8();
}
}
function foo7(x) {
var _loop_9 = function() {
var x_8 = void 0, y = void 0;
var a = arguments_9.length;
(function () { return x_8 + y + a; });
(function () { return x_8 + y + a; });
};
var arguments_9 = arguments;
do {
_loop_9();
} while (1 === 1);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_9 = 1;
var a = arguments_10.length;
(function () { return x_9 + y + a; });
(function () { return x_9 + y + a; });
};
var arguments_10 = arguments;
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
}
///=======const
function foo0_c(x) {
var _loop_11 = function(x_10) {
var a = arguments_11.length;
(function () { return x_10 + a; });
(function () { return x_10 + a; });
};
var arguments_11 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_10 = _a[_i];
_loop_11(x_10);
}
}
function foo0_1_c(x) {
var _loop_12 = function(x_11) {
var a = arguments_12.length;
(function () { return x_11 + a; });
(function () { return x_11 + a; });
};
var arguments_12 = arguments;
for (var x_11 in []) {
_loop_12(x_11);
}
}
function foo1_c(x) {
var _loop_13 = function(x_12) {
var a = arguments_13.length;
(function () { return x_12 + a; });
(function () { return x_12 + a; });
};
var arguments_13 = arguments;
for (var x_12 = 0; x_12 < 1;) {
_loop_13(x_12);
}
}
function foo2_c(x) {
var _loop_14 = function() {
var a = arguments_14.length;
(function () { return x + a; });
(function () { return x + a; });
};
var arguments_14 = arguments;
while (1 === 1) {
_loop_14();
}
}
function foo3_c(x) {
var _loop_15 = function() {
var x_13 = 1;
var a = arguments_15.length;
(function () { return x_13 + a; });
(function () { return x_13 + a; });
};
var arguments_15 = arguments;
do {
_loop_15();
} while (1 === 1);
}
function foo4_c(x) {
var _loop_16 = function(y) {
var a = arguments_16.length;
var x_14 = 1;
(function () { return x_14 + a; });
(function () { return x_14 + a; });
};
var arguments_16 = arguments;
for (var y = 0; y < 1;) {
_loop_16(y);
}
}
function foo5_c(x) {
var _loop_17 = function(x_15, y) {
var a = arguments_17.length;
(function () { return x_15 + y + a; });
(function () { return x_15 + y + a; });
};
var arguments_17 = arguments;
for (var x_15 = 0, y = 1; x_15 < 1;) {
_loop_17(x_15, y);
}
}
function foo6_c(x) {
var _loop_18 = function() {
var x_16 = 1, y = 1;
var a = arguments_18.length;
(function () { return x_16 + y + a; });
(function () { return x_16 + y + a; });
};
var arguments_18 = arguments;
while (1 === 1) {
_loop_18();
}
}
function foo7_c(x) {
var _loop_19 = function() {
var x_17 = 1, y = 1;
var a = arguments_19.length;
(function () { return x_17 + y + a; });
(function () { return x_17 + y + a; });
};
var arguments_19 = arguments;
do {
_loop_19();
} while (1 === 1);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_18 = 1;
var a = arguments_20.length;
(function () { return x_18 + y + a; });
(function () { return x_18 + y + a; });
};
var arguments_20 = arguments;
for (var y = 0; y < 1;) {
_loop_20(y);
}
}
@@ -0,0 +1,519 @@
=== tests/cases/compiler/capturedLetConstInLoop2.ts ===
// ========let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop2.ts, 0, 0))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
}
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop2.ts, 9, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 11, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
}
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop2.ts, 17, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 19, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
}
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop2.ts, 25, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
while (1 === 1) {
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
}
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop2.ts, 33, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 35, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
} while (1 === 1)
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop2.ts, 42, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 44, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
}
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop2.ts, 51, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 53, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
}
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop2.ts, 59, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 62, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
}
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop2.ts, 69, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 71, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
} while (1 === 1)
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop2.ts, 78, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 81, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
}
}
///=======const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop2.ts, 88, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 90, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
}
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop2.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 98, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
}
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop2.ts, 104, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 106, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
}
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop2.ts, 112, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
while (1 === 1) {
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
}
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop2.ts, 120, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 122, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
} while (1 === 1)
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop2.ts, 129, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 131, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 132, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 132, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
}
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop2.ts, 138, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 140, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
}
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop2.ts, 146, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 149, 16))
while (1 === 1) {
const x = 1, y =1 ;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
}
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop2.ts, 156, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 158, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
} while (1 === 1)
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop2.ts, 165, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 168, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
}
}
@@ -0,0 +1,726 @@
=== tests/cases/compiler/capturedLetConstInLoop2.ts ===
// ========let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
let x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
}
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
///=======const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
const x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y =1 ;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
@@ -0,0 +1,330 @@
//// [capturedLetConstInLoop2_ES6.ts]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y =1 ;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
//// [capturedLetConstInLoop2_ES6.js]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
} while (1 === 1);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function () { return x + a; });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
} while (1 === 1);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
} while (1 === 1);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function () { return x + a; });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
} while (1 === 1);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
@@ -0,0 +1,518 @@
=== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts ===
// ========let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop2_ES6.ts, 0, 0))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 2, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
}
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop2_ES6.ts, 8, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 10, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
}
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop2_ES6.ts, 16, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 18, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
}
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop2_ES6.ts, 24, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
while (1 === 1) {
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
}
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop2_ES6.ts, 32, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 34, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
} while (1 === 1)
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop2_ES6.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 43, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
}
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop2_ES6.ts, 50, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 52, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
}
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop2_ES6.ts, 58, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 61, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
}
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop2_ES6.ts, 68, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 70, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
} while (1 === 1)
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop2_ES6.ts, 77, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 80, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
}
}
///=======const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop2_ES6.ts, 87, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 89, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
}
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop2_ES6.ts, 95, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 97, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
}
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop2_ES6.ts, 103, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 105, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
}
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop2_ES6.ts, 111, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
while (1 === 1) {
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
}
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop2_ES6.ts, 119, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 121, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
} while (1 === 1)
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop2_ES6.ts, 128, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 130, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 131, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 131, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
}
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop2_ES6.ts, 137, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 139, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
}
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop2_ES6.ts, 145, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 148, 16))
while (1 === 1) {
const x = 1, y =1 ;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
}
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop2_ES6.ts, 155, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 157, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
} while (1 === 1)
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop2_ES6.ts, 164, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 167, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
}
}
@@ -0,0 +1,725 @@
=== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts ===
// ========let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
let x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
}
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
///=======const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
const x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y =1 ;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
@@ -0,0 +1,473 @@
//// [capturedLetConstInLoop3.ts]
///=========let
declare function use(a: any);
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//// [capturedLetConstInLoop3.js]
function foo0(x) {
var _loop_1 = function(x_1) {
v = x_1;
(function () { return x_1 + v; });
(function () { return x_1 + v; });
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
_loop_1(x_1);
}
use(v);
}
function foo0_1(x) {
var _loop_2 = function(x_2) {
v = x_2;
(function () { return x_2 + v; });
(function () { return x_2 + v; });
};
var v;
for (var x_2 in []) {
_loop_2(x_2);
}
use(v);
}
function foo1(x) {
var _loop_3 = function(x_3) {
v = x_3;
(function () { return x_3 + v; });
(function () { return x_3 + v; });
};
var v;
for (var x_3 = 0; x_3 < 1; ++x_3) {
_loop_3(x_3);
}
use(v);
}
function foo2(x) {
var _loop_4 = function() {
var x_4 = 1;
v = x_4;
(function () { return x_4 + v; });
(function () { return x_4 + v; });
};
var v;
while (1 === 1) {
_loop_4();
}
use(v);
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
};
var v;
do {
_loop_5();
} while (1 === 1);
use(v);
}
function foo4(x) {
var _loop_6 = function(y) {
v = y;
var x_6 = 1;
(function () { return x_6 + v; });
(function () { return x_6 + v; });
};
var v;
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
use(v);
}
function foo5(x) {
var _loop_7 = function(x_7, y) {
v = x_7;
(function () { return x_7 + y + v; });
(function () { return x_7 + y + v; });
};
var v;
for (var x_7 = 0, y = 1; x_7 < 1; ++x_7) {
_loop_7(x_7, y);
}
use(v);
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
};
var v;
while (1 === 1) {
_loop_8();
}
use(v);
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });
};
var v;
do {
_loop_9();
} while (1 === 1);
use(v);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_10 = 1;
v = x_10;
(function () { return x_10 + y + v; });
(function () { return x_10 + y + v; });
};
var v;
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
use(v);
}
//===const
function foo0_c(x) {
var _loop_11 = function(x_11) {
v = x_11;
(function () { return x_11 + v; });
(function () { return x_11 + v; });
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_11 = _a[_i];
_loop_11(x_11);
}
use(v);
}
function foo0_1_c(x) {
var _loop_12 = function(x_12) {
v = x_12;
(function () { return x_12 + v; });
(function () { return x_12 + v; });
};
var v;
for (var x_12 in []) {
_loop_12(x_12);
}
use(v);
}
function foo1_c(x) {
var _loop_13 = function(x_13) {
v = x_13;
(function () { return x_13 + v; });
(function () { return x_13 + v; });
};
var v;
for (var x_13 = 0; x_13 < 1;) {
_loop_13(x_13);
}
use(v);
}
function foo2_c(x) {
var _loop_14 = function() {
var x_14 = 1;
v = x_14;
(function () { return x_14 + v; });
(function () { return x_14 + v; });
};
var v;
while (1 === 1) {
_loop_14();
}
use(v);
}
function foo3_c(x) {
var _loop_15 = function() {
var x_15 = 1;
(function () { return x_15 + v; });
(function () { return x_15 + v; });
};
var v;
do {
_loop_15();
} while (1 === 1);
use(v);
}
function foo4_c(x) {
var _loop_16 = function(y) {
v = y;
var x_16 = 1;
(function () { return x_16 + v; });
(function () { return x_16 + v; });
};
var v;
for (var y = 0; y < 1;) {
_loop_16(y);
}
use(v);
}
function foo5_c(x) {
var _loop_17 = function(x_17, y) {
v = x_17;
(function () { return x_17 + y + v; });
(function () { return x_17 + y + v; });
};
var v;
for (var x_17 = 0, y = 1; x_17 < 1;) {
_loop_17(x_17, y);
}
use(v);
}
function foo6_c(x) {
var _loop_18 = function() {
var x_18 = 1, y = 1;
v = x_18;
(function () { return x_18 + y + v; });
(function () { return x_18 + y + v; });
};
var v;
while (1 === 1) {
_loop_18();
}
use(v);
}
function foo7_c(x) {
var _loop_19 = function() {
var x_19 = 1, y = 1;
v = x_19;
(function () { return x_19 + y + v; });
(function () { return x_19 + y + v; });
};
var v;
do {
_loop_19();
} while (1 === 1);
use(v);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_20 = 1;
v = x_20;
(function () { return x_20 + y + v; });
(function () { return x_20 + y + v; });
};
var v;
for (var y = 0; y < 1;) {
_loop_20(y);
}
use(v);
}
@@ -0,0 +1,565 @@
=== tests/cases/compiler/capturedLetConstInLoop3.ts ===
///=========let
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop3.ts, 1, 21))
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop3.ts, 1, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 2, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop3.ts, 10, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 12, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop3.ts, 20, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 22, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop3.ts, 30, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 32, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop3.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 43, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop3.ts, 52, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 54, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop3.ts, 63, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 65, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop3.ts, 73, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 76, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop3.ts, 85, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 87, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop3.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 99, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
}
//===const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop3.ts, 108, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 110, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop3.ts, 118, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 120, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop3.ts, 128, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 130, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop3.ts, 138, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 140, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop3.ts, 149, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 151, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop3.ts, 160, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 162, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop3.ts, 171, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 173, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop3.ts, 181, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 184, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop3.ts, 193, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 195, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop3.ts, 204, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 207, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
}
@@ -0,0 +1,794 @@
=== tests/cases/compiler/capturedLetConstInLoop3.ts ===
///=========let
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//===const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
const x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
@@ -0,0 +1,394 @@
//// [capturedLetConstInLoop3_ES6.ts]
///=========let
declare function use(a: any);
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//// [capturedLetConstInLoop3_ES6.js]
function foo0(x) {
for (let x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function () { return x + v; });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo7(x) {
do {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function () { return x + v; });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
@@ -0,0 +1,566 @@
=== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts ===
///=========let
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop3_ES6.ts, 2, 21))
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop3_ES6.ts, 2, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop3_ES6.ts, 11, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 13, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop3_ES6.ts, 21, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 23, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop3_ES6.ts, 31, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 33, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop3_ES6.ts, 42, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 44, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop3_ES6.ts, 53, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 55, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop3_ES6.ts, 64, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 66, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop3_ES6.ts, 74, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 77, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop3_ES6.ts, 86, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 88, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop3_ES6.ts, 97, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 100, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
}
//===const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop3_ES6.ts, 109, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 111, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop3_ES6.ts, 119, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 121, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop3_ES6.ts, 129, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 131, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop3_ES6.ts, 139, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 141, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop3_ES6.ts, 150, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 152, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop3_ES6.ts, 161, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 163, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop3_ES6.ts, 172, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 174, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop3_ES6.ts, 182, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 185, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop3_ES6.ts, 194, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 196, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop3_ES6.ts, 205, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 208, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
}
@@ -0,0 +1,795 @@
=== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts ===
///=========let
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//===const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
const x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
@@ -0,0 +1,338 @@
//// [capturedLetConstInLoop4.ts]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function() { return x + v0});
(() => x);
}
for (let x in []) {
var v00 = x;
(function() { return x + v00});
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function() { return x + v1});
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function() { return x + v2});
(() => x);
}
do {
let x;
var v3 = x;
(function() { return x + v3});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function() { return x + v4});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function() { return x + y + v5});
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function() { return x + y + v6});
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function() { return x + y + v7});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function() { return x + y + v8});
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function() { return x + v0_c});
(() => x);
}
for (const x in []) {
var v00_c = x;
(function() { return x + v00});
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function() { return x + v1_c});
(() => x);
}
while (1 === 1) {
const x =1;
var v2_c = x;
(function() { return x + v2_c});
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function() { return x + v3_c});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function() { return x + v4_c});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function() { return x + y + v5_c});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function() { return x + y + v6_c});
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function() { return x + y + v7_c});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function() { return x + y + v8_c});
(() => x + y);
}
//// [capturedLetConstInLoop4.js]
System.register([], function(exports_1) {
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
//======let
function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
exports_1("exportedFoo", exportedFoo);
//======const
function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
exports_1("exportedFoo2", exportedFoo2);
return {
setters:[],
execute: function() {
var _loop_1 = function(x) {
v0 = x;
(function () { return x + v0; });
(function () { return x; });
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
_loop_1(x);
}
var _loop_2 = function(x) {
v00 = x;
(function () { return x + v00; });
(function () { return x; });
};
for (var x in []) {
_loop_2(x);
}
var _loop_3 = function(x) {
v1 = x;
(function () { return x + v1; });
(function () { return x; });
};
for (var x = 0; x < 1; ++x) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
v2 = x;
(function () { return x + v2; });
(function () { return x; });
};
while (1 === 1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
v3 = x;
(function () { return x + v3; });
(function () { return x; });
};
do {
_loop_5();
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
v4 = x;
(function () { return x + v4; });
(function () { return x; });
};
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
var _loop_7 = function(x, y) {
v5 = x;
(function () { return x + y + v5; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1; ++x) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
v6 = x;
(function () { return x + y + v6; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
v7 = x;
(function () { return x + y + v7; });
(function () { return x + y; });
};
do {
_loop_9();
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
v8 = x;
(function () { return x + y + v8; });
(function () { return x + y; });
};
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
var _loop_11 = function(x) {
v0_c = x;
(function () { return x + v0_c; });
(function () { return x; });
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
_loop_11(x);
}
var _loop_12 = function(x) {
v00_c = x;
(function () { return x + v00; });
(function () { return x; });
};
for (var x in []) {
_loop_12(x);
}
var _loop_13 = function(x) {
v1_c = x;
(function () { return x + v1_c; });
(function () { return x; });
};
for (var x = 0; x < 1;) {
_loop_13(x);
}
var _loop_14 = function() {
var x = 1;
v2_c = x;
(function () { return x + v2_c; });
(function () { return x; });
};
while (1 === 1) {
_loop_14();
}
var _loop_15 = function() {
var x = 1;
v3_c = x;
(function () { return x + v3_c; });
(function () { return x; });
};
do {
_loop_15();
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
v4_c = x;
(function () { return x + v4_c; });
(function () { return x; });
};
for (var y = 0; y < 1;) {
_loop_16(y);
}
var _loop_17 = function(x, y) {
v5_c = x;
(function () { return x + y + v5_c; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1;) {
_loop_17(x, y);
}
var _loop_18 = function() {
var x = 1, y = 1;
v6_c = x;
(function () { return x + y + v6_c; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_18();
}
var _loop_19 = function() {
var x = 1, y = 1;
v7_c = x;
(function () { return x + y + v7_c; });
(function () { return x + y; });
};
do {
_loop_19();
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
v8_c = x;
(function () { return x + y + v8_c; });
(function () { return x + y; });
};
for (var y = 0; y < 1;) {
_loop_20(y);
}
}
}
});
@@ -0,0 +1,394 @@
=== tests/cases/compiler/capturedLetConstInLoop4.ts ===
//======let
export function exportedFoo() {
>exportedFoo : Symbol(exportedFoo, Decl(capturedLetConstInLoop4.ts, 0, 0))
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
var v0 = x;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
(function() { return x + v0});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
var v00 = x;
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
var v1 = x;
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
(function() { return x + v1});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
var v2 = x;
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
(function() { return x + v2});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
var v3 = x;
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
(function() { return x + v3});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
var v4 = x;
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
(function() { return x + v4});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
var v5 = x;
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
(function() { return x + y + v5});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
var v6 = x;
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
(function() { return x + y + v6});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
var v7 = x;
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
(function() { return x + y + v7});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
var v8 = x;
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
(function() { return x + y + v8});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
}
//======const
export function exportedFoo2() {
>exportedFoo2 : Symbol(exportedFoo2, Decl(capturedLetConstInLoop4.ts, 70, 1))
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4.ts, 84, 7))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
var v0_c = x;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
(function() { return x + v0_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
var v00_c = x;
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4.ts, 84, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
var v1_c = x;
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
(function() { return x + v1_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
}
while (1 === 1) {
const x =1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
var v2_c = x;
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
(function() { return x + v2_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
var v3_c = x;
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
(function() { return x + v3_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 109, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 109, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
var v4_c = x;
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
(function() { return x + v4_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
var v5_c = x;
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
(function() { return x + y + v5_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
var v6_c = x;
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
(function() { return x + y + v6_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
var v7_c = x;
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
(function() { return x + y + v7_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
var v8_c = x;
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
(function() { return x + y + v8_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
}
@@ -0,0 +1,600 @@
=== tests/cases/compiler/capturedLetConstInLoop4.ts ===
//======let
export function exportedFoo() {
>exportedFoo : () => any
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 : any
>v0 + v00 + v1 + v2 + v3 + v4 : any
>v0 + v00 + v1 + v2 + v3 : any
>v0 + v00 + v1 + v2 : any
>v0 + v00 + v1 : any
>v0 + v00 : any
>v0 : any
>v00 : any
>v1 : number
>v2 : any
>v3 : any
>v4 : number
>v5 : number
>v6 : any
>v7 : any
>v8 : number
}
for (let x of []) {
>x : any
>[] : undefined[]
var v0 = x;
>v0 : any
>x : any
(function() { return x + v0});
>(function() { return x + v0}) : () => any
>function() { return x + v0} : () => any
>x + v0 : any
>x : any
>v0 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x in []) {
>x : any
>[] : undefined[]
var v00 = x;
>v00 : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v1 = x;
>v1 : number
>x : number
(function() { return x + v1});
>(function() { return x + v1}) : () => number
>function() { return x + v1} : () => number
>x + v1 : number
>x : number
>v1 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
var v2 = x;
>v2 : any
>x : any
(function() { return x + v2});
>(function() { return x + v2}) : () => any
>function() { return x + v2} : () => any
>x + v2 : any
>x : any
>v2 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
var v3 = x;
>v3 : any
>x : any
(function() { return x + v3});
>(function() { return x + v3}) : () => any
>function() { return x + v3} : () => any
>x + v3 : any
>x : any
>v3 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v4 = x;
>v4 : number
>x : number
(function() { return x + v4});
>(function() { return x + v4}) : () => number
>function() { return x + v4} : () => number
>x + v4 : number
>x : number
>v4 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v5 = x;
>v5 : number
>x : number
(function() { return x + y + v5});
>(function() { return x + y + v5}) : () => number
>function() { return x + y + v5} : () => number
>x + y + v5 : number
>x + y : number
>x : number
>y : number
>v5 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v6 = x;
>v6 : any
>x : any
(function() { return x + y + v6});
>(function() { return x + y + v6}) : () => any
>function() { return x + y + v6} : () => any
>x + y + v6 : any
>x + y : any
>x : any
>y : any
>v6 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
var v7 = x;
>v7 : any
>x : any
(function() { return x + y + v7});
>(function() { return x + y + v7}) : () => any
>function() { return x + y + v7} : () => any
>x + y + v7 : any
>x + y : any
>x : any
>y : any
>v7 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v8 = x;
>v8 : number
>x : number
(function() { return x + y + v8});
>(function() { return x + y + v8}) : () => number
>function() { return x + y + v8} : () => number
>x + y + v8 : number
>x + y : number
>x : number
>y : number
>v8 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//======const
export function exportedFoo2() {
>exportedFoo2 : () => any
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c : any
>v0_c + v00_c + v1_c + v2_c : any
>v0_c + v00_c + v1_c : any
>v0_c + v00_c : any
>v0_c : any
>v00_c : any
>v1_c : number
>v2_c : number
>v3_c : number
>v4_c : number
>v5_c : number
>v6_c : number
>v7_c : number
>v8_c : number
}
for (const x of []) {
>x : any
>[] : undefined[]
var v0_c = x;
>v0_c : any
>x : any
(function() { return x + v0_c});
>(function() { return x + v0_c}) : () => any
>function() { return x + v0_c} : () => any
>x + v0_c : any
>x : any
>v0_c : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x in []) {
>x : any
>[] : undefined[]
var v00_c = x;
>v00_c : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v1_c = x;
>v1_c : number
>x : number
(function() { return x + v1_c});
>(function() { return x + v1_c}) : () => number
>function() { return x + v1_c} : () => number
>x + v1_c : number
>x : number
>v1_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x =1;
>x : number
>1 : number
var v2_c = x;
>v2_c : number
>x : number
(function() { return x + v2_c});
>(function() { return x + v2_c}) : () => number
>function() { return x + v2_c} : () => number
>x + v2_c : number
>x : number
>v2_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
var v3_c = x;
>v3_c : number
>x : number
(function() { return x + v3_c});
>(function() { return x + v3_c}) : () => number
>function() { return x + v3_c} : () => number
>x + v3_c : number
>x : number
>v3_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v4_c = x;
>v4_c : number
>x : number
(function() { return x + v4_c});
>(function() { return x + v4_c}) : () => number
>function() { return x + v4_c} : () => number
>x + v4_c : number
>x : number
>v4_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v5_c = x;
>v5_c : number
>x : number
(function() { return x + y + v5_c});
>(function() { return x + y + v5_c}) : () => number
>function() { return x + y + v5_c} : () => number
>x + y + v5_c : number
>x + y : number
>x : number
>y : number
>v5_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v6_c = x;
>v6_c : number
>x : number
(function() { return x + y + v6_c});
>(function() { return x + y + v6_c}) : () => number
>function() { return x + y + v6_c} : () => number
>x + y + v6_c : number
>x + y : number
>x : number
>y : number
>v6_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v7_c = x;
>v7_c : number
>x : number
(function() { return x + y + v7_c});
>(function() { return x + y + v7_c}) : () => number
>function() { return x + y + v7_c} : () => number
>x + y + v7_c : number
>x + y : number
>x : number
>y : number
>v7_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v8_c = x;
>v8_c : number
>x : number
(function() { return x + y + v8_c});
>(function() { return x + y + v8_c}) : () => number
>function() { return x + y + v8_c} : () => number
>x + y + v8_c : number
>x + y : number
>x : number
>y : number
>v8_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
@@ -0,0 +1,266 @@
//// [capturedLetConstInLoop4_ES6.ts]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function() { return x + v0});
(() => x);
}
for (let x in []) {
var v00 = x;
(function() { return x + v00});
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function() { return x + v1});
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function() { return x + v2});
(() => x);
}
do {
let x;
var v3 = x;
(function() { return x + v3});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function() { return x + v4});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function() { return x + y + v5});
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function() { return x + y + v6});
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function() { return x + y + v7});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function() { return x + y + v8});
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function() { return x + v0_c});
(() => x);
}
for (const x in []) {
var v00_c = x;
(function() { return x + v00});
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function() { return x + v1_c});
(() => x);
}
while (1 === 1) {
const x =1;
var v2_c = x;
(function() { return x + v2_c});
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function() { return x + v3_c});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function() { return x + v4_c});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function() { return x + y + v5_c});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function() { return x + y + v6_c});
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function() { return x + y + v7_c});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function() { return x + y + v8_c});
(() => x + y);
}
//// [capturedLetConstInLoop4_ES6.js]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function () { return x + v0; });
(() => x);
}
for (let x in []) {
var v00 = x;
(function () { return x + v00; });
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function () { return x + v1; });
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function () { return x + v2; });
(() => x);
}
do {
let x;
var v3 = x;
(function () { return x + v3; });
(() => x);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function () { return x + v4; });
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function () { return x + y + v5; });
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function () { return x + y + v6; });
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function () { return x + y + v7; });
(() => x + y);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function () { return x + y + v8; });
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function () { return x + v0_c; });
(() => x);
}
for (const x in []) {
var v00_c = x;
(function () { return x + v00; });
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function () { return x + v1_c; });
(() => x);
}
while (1 === 1) {
const x = 1;
var v2_c = x;
(function () { return x + v2_c; });
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function () { return x + v3_c; });
(() => x);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function () { return x + v4_c; });
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function () { return x + y + v5_c; });
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function () { return x + y + v6_c; });
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function () { return x + y + v7_c; });
(() => x + y);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function () { return x + y + v8_c; });
(() => x + y);
}
@@ -0,0 +1,394 @@
=== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts ===
//======let
export function exportedFoo() {
>exportedFoo : Symbol(exportedFoo, Decl(capturedLetConstInLoop4_ES6.ts, 0, 0))
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
var v0 = x;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
(function() { return x + v0});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
var v00 = x;
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
var v1 = x;
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
(function() { return x + v1});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
var v2 = x;
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
(function() { return x + v2});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
var v3 = x;
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
(function() { return x + v3});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
var v4 = x;
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
(function() { return x + v4});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
var v5 = x;
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
(function() { return x + y + v5});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
var v6 = x;
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
(function() { return x + y + v6});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
var v7 = x;
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
(function() { return x + y + v7});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
var v8 = x;
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
(function() { return x + y + v8});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
}
//======const
export function exportedFoo2() {
>exportedFoo2 : Symbol(exportedFoo2, Decl(capturedLetConstInLoop4_ES6.ts, 70, 1))
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4_ES6.ts, 84, 7))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
var v0_c = x;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
(function() { return x + v0_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
var v00_c = x;
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4_ES6.ts, 84, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
var v1_c = x;
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
(function() { return x + v1_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
}
while (1 === 1) {
const x =1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
var v2_c = x;
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
(function() { return x + v2_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
var v3_c = x;
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
(function() { return x + v3_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 109, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 109, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
var v4_c = x;
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
(function() { return x + v4_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
var v5_c = x;
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
(function() { return x + y + v5_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
var v6_c = x;
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
(function() { return x + y + v6_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
var v7_c = x;
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
(function() { return x + y + v7_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
var v8_c = x;
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
(function() { return x + y + v8_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
}
@@ -0,0 +1,600 @@
=== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts ===
//======let
export function exportedFoo() {
>exportedFoo : () => any
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 : any
>v0 + v00 + v1 + v2 + v3 + v4 : any
>v0 + v00 + v1 + v2 + v3 : any
>v0 + v00 + v1 + v2 : any
>v0 + v00 + v1 : any
>v0 + v00 : any
>v0 : any
>v00 : any
>v1 : number
>v2 : any
>v3 : any
>v4 : number
>v5 : number
>v6 : any
>v7 : any
>v8 : number
}
for (let x of []) {
>x : any
>[] : undefined[]
var v0 = x;
>v0 : any
>x : any
(function() { return x + v0});
>(function() { return x + v0}) : () => any
>function() { return x + v0} : () => any
>x + v0 : any
>x : any
>v0 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x in []) {
>x : any
>[] : undefined[]
var v00 = x;
>v00 : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v1 = x;
>v1 : number
>x : number
(function() { return x + v1});
>(function() { return x + v1}) : () => number
>function() { return x + v1} : () => number
>x + v1 : number
>x : number
>v1 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
var v2 = x;
>v2 : any
>x : any
(function() { return x + v2});
>(function() { return x + v2}) : () => any
>function() { return x + v2} : () => any
>x + v2 : any
>x : any
>v2 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
var v3 = x;
>v3 : any
>x : any
(function() { return x + v3});
>(function() { return x + v3}) : () => any
>function() { return x + v3} : () => any
>x + v3 : any
>x : any
>v3 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v4 = x;
>v4 : number
>x : number
(function() { return x + v4});
>(function() { return x + v4}) : () => number
>function() { return x + v4} : () => number
>x + v4 : number
>x : number
>v4 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v5 = x;
>v5 : number
>x : number
(function() { return x + y + v5});
>(function() { return x + y + v5}) : () => number
>function() { return x + y + v5} : () => number
>x + y + v5 : number
>x + y : number
>x : number
>y : number
>v5 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v6 = x;
>v6 : any
>x : any
(function() { return x + y + v6});
>(function() { return x + y + v6}) : () => any
>function() { return x + y + v6} : () => any
>x + y + v6 : any
>x + y : any
>x : any
>y : any
>v6 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
var v7 = x;
>v7 : any
>x : any
(function() { return x + y + v7});
>(function() { return x + y + v7}) : () => any
>function() { return x + y + v7} : () => any
>x + y + v7 : any
>x + y : any
>x : any
>y : any
>v7 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v8 = x;
>v8 : number
>x : number
(function() { return x + y + v8});
>(function() { return x + y + v8}) : () => number
>function() { return x + y + v8} : () => number
>x + y + v8 : number
>x + y : number
>x : number
>y : number
>v8 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//======const
export function exportedFoo2() {
>exportedFoo2 : () => any
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c : any
>v0_c + v00_c + v1_c + v2_c : any
>v0_c + v00_c + v1_c : any
>v0_c + v00_c : any
>v0_c : any
>v00_c : any
>v1_c : number
>v2_c : number
>v3_c : number
>v4_c : number
>v5_c : number
>v6_c : number
>v7_c : number
>v8_c : number
}
for (const x of []) {
>x : any
>[] : undefined[]
var v0_c = x;
>v0_c : any
>x : any
(function() { return x + v0_c});
>(function() { return x + v0_c}) : () => any
>function() { return x + v0_c} : () => any
>x + v0_c : any
>x : any
>v0_c : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x in []) {
>x : any
>[] : undefined[]
var v00_c = x;
>v00_c : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v1_c = x;
>v1_c : number
>x : number
(function() { return x + v1_c});
>(function() { return x + v1_c}) : () => number
>function() { return x + v1_c} : () => number
>x + v1_c : number
>x : number
>v1_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x =1;
>x : number
>1 : number
var v2_c = x;
>v2_c : number
>x : number
(function() { return x + v2_c});
>(function() { return x + v2_c}) : () => number
>function() { return x + v2_c} : () => number
>x + v2_c : number
>x : number
>v2_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
var v3_c = x;
>v3_c : number
>x : number
(function() { return x + v3_c});
>(function() { return x + v3_c}) : () => number
>function() { return x + v3_c} : () => number
>x + v3_c : number
>x : number
>v3_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v4_c = x;
>v4_c : number
>x : number
(function() { return x + v4_c});
>(function() { return x + v4_c}) : () => number
>function() { return x + v4_c} : () => number
>x + v4_c : number
>x : number
>v4_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v5_c = x;
>v5_c : number
>x : number
(function() { return x + y + v5_c});
>(function() { return x + y + v5_c}) : () => number
>function() { return x + y + v5_c} : () => number
>x + y + v5_c : number
>x + y : number
>x : number
>y : number
>v5_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v6_c = x;
>v6_c : number
>x : number
(function() { return x + y + v6_c});
>(function() { return x + y + v6_c}) : () => number
>function() { return x + y + v6_c} : () => number
>x + y + v6_c : number
>x + y : number
>x : number
>y : number
>v6_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v7_c = x;
>v7_c : number
>x : number
(function() { return x + y + v7_c});
>(function() { return x + y + v7_c}) : () => number
>function() { return x + y + v7_c} : () => number
>x + y + v7_c : number
>x + y : number
>x : number
>y : number
>v7_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v8_c = x;
>v8_c : number
>x : number
(function() { return x + y + v8_c});
>(function() { return x + y + v8_c}) : () => number
>function() { return x + y + v8_c} : () => number
>x + y + v8_c : number
>x + y : number
>x : number
>y : number
>v8_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
@@ -0,0 +1,617 @@
//// [capturedLetConstInLoop5.ts]
declare function use(a: any);
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
};
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//// [capturedLetConstInLoop5.js]
//====let
function foo0(x) {
var _loop_1 = function(x_1) {
v = x_1;
(function () { return x_1 + v; });
(function () { return x_1 + v; });
if (x_1 == 1) {
return { value: void 0 };
}
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
var state_1 = _loop_1(x_1);
if (typeof state_1 === "object") return state_1.value
}
use(v);
}
function foo00(x) {
var _loop_2 = function(x_2) {
v = x_2;
(function () { return x_2 + v; });
(function () { return x_2 + v; });
if (x_2 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_2 in []) {
var state_2 = _loop_2(x_2);
if (typeof state_2 === "object") return state_2.value
}
use(v);
}
function foo1(x) {
var _loop_3 = function(x_3) {
v = x_3;
(function () { return x_3 + v; });
(function () { return x_3 + v; });
if (x_3 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_3 = 0; x_3 < 1; ++x_3) {
var state_3 = _loop_3(x_3);
if (typeof state_3 === "object") return state_3.value
}
use(v);
}
function foo2(x) {
var _loop_4 = function() {
var x_4 = 1;
v = x_4;
(function () { return x_4 + v; });
(function () { return x_4 + v; });
if (x_4 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_4 = _loop_4();
if (typeof state_4 === "object") return state_4.value
}
use(v);
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
if (x_5 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_5 = _loop_5();
if (typeof state_5 === "object") return state_5.value
} while (1 === 1);
use(v);
}
function foo4(x) {
var _loop_6 = function(y) {
v = y;
var x_6 = 1;
(function () { return x_6 + v; });
(function () { return x_6 + v; });
if (x_6 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (typeof state_6 === "object") return state_6.value
}
use(v);
}
function foo5(x) {
var _loop_7 = function(x_7, y) {
v = x_7;
(function () { return x_7 + y + v; });
(function () { return x_7 + y + v; });
if (x_7 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_7 = 0, y = 1; x_7 < 1; ++x_7) {
var state_7 = _loop_7(x_7, y);
if (typeof state_7 === "object") return state_7.value
}
use(v);
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
if (x_8 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_8 = _loop_8();
if (typeof state_8 === "object") return state_8.value
}
;
use(v);
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });
if (x_9 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_9 = _loop_9();
if (typeof state_9 === "object") return state_9.value
} while (1 === 1);
use(v);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_10 = 1;
v = x_10;
(function () { return x_10 + y + v; });
(function () { return x_10 + y + v; });
if (x_10 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (typeof state_10 === "object") return state_10.value
}
use(v);
}
//====const
function foo0_c(x) {
var _loop_11 = function(x_11) {
v = x_11;
(function () { return x_11 + v; });
(function () { return x_11 + v; });
if (x_11 == 1) {
return { value: void 0 };
}
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_11 = _a[_i];
var state_11 = _loop_11(x_11);
if (typeof state_11 === "object") return state_11.value
}
use(v);
}
function foo00_c(x) {
var _loop_12 = function(x_12) {
v = x_12;
(function () { return x_12 + v; });
(function () { return x_12 + v; });
if (x_12 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_12 in []) {
var state_12 = _loop_12(x_12);
if (typeof state_12 === "object") return state_12.value
}
use(v);
}
function foo1_c(x) {
var _loop_13 = function(x_13) {
v = x_13;
(function () { return x_13 + v; });
(function () { return x_13 + v; });
if (x_13 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_13 = 0; x_13 < 1;) {
var state_13 = _loop_13(x_13);
if (typeof state_13 === "object") return state_13.value
}
use(v);
}
function foo2_c(x) {
var _loop_14 = function() {
var x_14 = 1;
v = x_14;
(function () { return x_14 + v; });
(function () { return x_14 + v; });
if (x_14 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_14 = _loop_14();
if (typeof state_14 === "object") return state_14.value
}
use(v);
}
function foo3_c(x) {
var _loop_15 = function() {
var x_15 = 1;
(function () { return x_15 + v; });
(function () { return x_15 + v; });
if (x_15 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_15 = _loop_15();
if (typeof state_15 === "object") return state_15.value
} while (1 === 1);
use(v);
}
function foo4_c(x) {
var _loop_16 = function(y) {
v = y;
var x_16 = 1;
(function () { return x_16 + v; });
(function () { return x_16 + v; });
if (x_16 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (typeof state_16 === "object") return state_16.value
}
use(v);
}
function foo5_c(x) {
var _loop_17 = function(x_17, y) {
v = x_17;
(function () { return x_17 + y + v; });
(function () { return x_17 + y + v; });
if (x_17 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_17 = 0, y = 1; x_17 < 1;) {
var state_17 = _loop_17(x_17, y);
if (typeof state_17 === "object") return state_17.value
}
use(v);
}
function foo6_c(x) {
var _loop_18 = function() {
var x_18 = 1, y = 1;
v = x_18;
(function () { return x_18 + y + v; });
(function () { return x_18 + y + v; });
if (x_18 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_18 = _loop_18();
if (typeof state_18 === "object") return state_18.value
}
use(v);
}
function foo7_c(x) {
var _loop_19 = function() {
var x_19 = 1, y = 1;
v = x_19;
(function () { return x_19 + y + v; });
(function () { return x_19 + y + v; });
if (x_19 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_19 = _loop_19();
if (typeof state_19 === "object") return state_19.value
} while (1 === 1);
use(v);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_20 = 1;
v = x_20;
(function () { return x_20 + y + v; });
(function () { return x_20 + y + v; });
if (x_20 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (typeof state_20 === "object") return state_20.value
}
use(v);
}
@@ -0,0 +1,682 @@
=== tests/cases/compiler/capturedLetConstInLoop5.ts ===
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop5.ts, 0, 21))
//====let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5.ts, 0, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
}
function foo00(x) {
>foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5.ts, 14, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 16, 15))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5.ts, 27, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 29, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5.ts, 40, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 42, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5.ts, 54, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 56, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5.ts, 68, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 70, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5.ts, 82, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 84, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5.ts, 95, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 98, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
return;
}
};
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5.ts, 110, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 112, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
return;
}
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5.ts, 124, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 127, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
}
//====const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5.ts, 139, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 142, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
}
function foo00_c(x) {
>foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5.ts, 153, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 155, 17))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5.ts, 166, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 168, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5.ts, 179, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 181, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5.ts, 193, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 195, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5.ts, 207, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 209, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5.ts, 221, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 223, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5.ts, 234, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 237, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
return;
}
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5.ts, 249, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 251, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5.ts, 263, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 266, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
}
@@ -0,0 +1,951 @@
=== tests/cases/compiler/capturedLetConstInLoop5.ts ===
declare function use(a: any);
>use : (a: any) => any
>a : any
//====let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00(x) {
>foo00 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
};
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//====const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00_c(x) {
>foo00_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
@@ -0,0 +1,518 @@
//// [capturedLetConstInLoop5_ES6.ts]
declare function use(a: any);
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
};
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//// [capturedLetConstInLoop5_ES6.js]
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
;
use(v);
}
function foo7(x) {
do {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
@@ -0,0 +1,683 @@
=== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts ===
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop5_ES6.ts, 1, 21))
//====let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5_ES6.ts, 1, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
}
function foo00(x) {
>foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5_ES6.ts, 15, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 15))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5_ES6.ts, 28, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5_ES6.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 43, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5_ES6.ts, 55, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 57, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5_ES6.ts, 69, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 71, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5_ES6.ts, 83, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5_ES6.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 99, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
return;
}
};
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5_ES6.ts, 111, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 113, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
return;
}
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5_ES6.ts, 125, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 128, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
}
//====const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5_ES6.ts, 140, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
}
function foo00_c(x) {
>foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5_ES6.ts, 154, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 17))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5_ES6.ts, 167, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5_ES6.ts, 180, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 182, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5_ES6.ts, 194, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 196, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5_ES6.ts, 208, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 210, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5_ES6.ts, 222, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5_ES6.ts, 235, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 238, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
return;
}
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5_ES6.ts, 250, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 252, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5_ES6.ts, 264, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 267, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
}
@@ -0,0 +1,952 @@
=== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts ===
declare function use(a: any);
>use : (a: any) => any
>a : any
//====let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00(x) {
>foo00 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
};
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//====const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00_c(x) {
>foo00_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
@@ -0,0 +1,557 @@
//// [capturedLetConstInLoop6.ts]
// ====let
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
//// [capturedLetConstInLoop6.js]
// ====let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
var state_1 = _loop_1(x);
if (state_1 === "break") break;
if (state_1 === "continue") continue;
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x in []) {
var state_2 = _loop_2(x);
if (state_2 === "break") break;
if (state_2 === "continue") continue;
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0; x < 1; ++x) {
var state_3 = _loop_3(x);
if (state_3 === "break") break;
if (state_3 === "continue") continue;
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_4 = _loop_4();
if (state_4 === "break") break;
if (state_4 === "continue") continue;
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_5 = _loop_5();
if (state_5 === "break") break;
if (state_5 === "continue") continue;
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (state_6 === "break") break;
if (state_6 === "continue") continue;
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0, y = 1; x < 1; ++x) {
var state_7 = _loop_7(x, y);
if (state_7 === "break") break;
if (state_7 === "continue") continue;
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_8 = _loop_8();
if (state_8 === "break") break;
if (state_8 === "continue") continue;
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_9 = _loop_9();
if (state_9 === "break") break;
if (state_9 === "continue") continue;
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (state_10 === "break") break;
if (state_10 === "continue") continue;
}
// ====const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
var state_11 = _loop_11(x);
if (state_11 === "break") break;
if (state_11 === "continue") continue;
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x in []) {
var state_12 = _loop_12(x);
if (state_12 === "break") break;
if (state_12 === "continue") continue;
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0; x < 1;) {
var state_13 = _loop_13(x);
if (state_13 === "break") break;
if (state_13 === "continue") continue;
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_14 = _loop_14();
if (state_14 === "break") break;
if (state_14 === "continue") continue;
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_15 = _loop_15();
if (state_15 === "break") break;
if (state_15 === "continue") continue;
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (state_16 === "break") break;
if (state_16 === "continue") continue;
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0, y = 1; x < 1;) {
var state_17 = _loop_17(x, y);
if (state_17 === "break") break;
if (state_17 === "continue") continue;
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_18 = _loop_18();
if (state_18 === "break") break;
if (state_18 === "continue") continue;
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_19 = _loop_19();
if (state_19 === "break") break;
if (state_19 === "continue") continue;
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (state_20 === "break") break;
if (state_20 === "continue") continue;
}
@@ -0,0 +1,481 @@
=== tests/cases/compiler/capturedLetConstInLoop6.ts ===
// ====let
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
continue;
}
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
continue;
}
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
continue;
}
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
continue;
}
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
continue;
}
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
continue;
}
}
// ====const
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
continue;
}
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
continue;
}
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
continue;
}
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
continue;
}
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 178, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 178, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
continue;
}
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
continue;
}
}
@@ -0,0 +1,729 @@
=== tests/cases/compiler/capturedLetConstInLoop6.ts ===
// ====let
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
// ====const
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
@@ -0,0 +1,455 @@
//// [capturedLetConstInLoop6_ES6.ts]
// ====let
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
//// [capturedLetConstInLoop6_ES6.js]
// ====let
for (let x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
@@ -0,0 +1,481 @@
=== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts ===
// ====let
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
continue;
}
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
continue;
}
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
continue;
}
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
continue;
}
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
continue;
}
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
continue;
}
}
// ====const
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
continue;
}
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
continue;
}
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
continue;
}
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
continue;
}
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 178, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 178, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
continue;
}
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
continue;
}
}
@@ -0,0 +1,729 @@
=== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts ===
// ====let
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
// ====const
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
@@ -0,0 +1,894 @@
//// [capturedLetConstInLoop7.ts]
//===let
l0:
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00:
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2:
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3:
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7:
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c:
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c:
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}
//// [capturedLetConstInLoop7.js]
//===let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l0";
}
};
l0: for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
var state_1 = _loop_1(x);
if (state_1 === "break") break;
if (state_1 === "continue") continue;
switch(state_1) {
case "break-l0": break l0;
case "continue-l0": continue l0;
}
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l00";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l00";
}
};
l00: for (var x in []) {
var state_2 = _loop_2(x);
if (state_2 === "break") break;
if (state_2 === "continue") continue;
switch(state_2) {
case "break-l00": break l00;
case "continue-l00": continue l00;
}
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
};
l1: for (var x = 0; x < 1; ++x) {
var state_3 = _loop_3(x);
if (state_3 === "break") break;
if (state_3 === "continue") continue;
switch(state_3) {
case "break-l1": break l1;
case "continue-l1": continue l1;
}
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l2";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l2";
}
};
l2: while (1 === 1) {
var state_4 = _loop_4();
if (state_4 === "break") break;
if (state_4 === "continue") continue;
switch(state_4) {
case "break-l2": break l2;
case "continue-l2": continue l2;
}
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l3";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l3";
}
};
l3: do {
var state_5 = _loop_5();
if (state_5 === "break") break;
if (state_5 === "continue") continue;
switch(state_5) {
case "break-l3": break l3;
case "continue-l3": continue l3;
}
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l4";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l4";
}
};
l4: for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (state_6 === "break") break;
if (state_6 === "continue") continue;
switch(state_6) {
case "break-l4": break l4;
case "continue-l4": continue l4;
}
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l5";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l5";
}
};
l5: for (var x = 0, y = 1; x < 1; ++x) {
var state_7 = _loop_7(x, y);
if (state_7 === "break") break;
if (state_7 === "continue") continue;
switch(state_7) {
case "break-l5": break l5;
case "continue-l5": continue l5;
}
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l6";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l6";
}
};
l6: while (1 === 1) {
var state_8 = _loop_8();
if (state_8 === "break") break;
if (state_8 === "continue") continue;
switch(state_8) {
case "break-l6": break l6;
case "continue-l6": continue l6;
}
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l7";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l7";
}
};
l7: do {
var state_9 = _loop_9();
if (state_9 === "break") break;
if (state_9 === "continue") continue;
switch(state_9) {
case "break-l7": break l7;
case "continue-l7": continue l7;
}
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l8";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l8";
}
};
l8: for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (state_10 === "break") break;
if (state_10 === "continue") continue;
switch(state_10) {
case "break-l8": break l8;
case "continue-l8": continue l8;
}
}
//===const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l0_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l0_c";
}
};
l0_c: for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
var state_11 = _loop_11(x);
if (state_11 === "break") break;
if (state_11 === "continue") continue;
switch(state_11) {
case "break-l0_c": break l0_c;
case "continue-l0_c": continue l0_c;
}
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l00_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l00_c";
}
};
l00_c: for (var x in []) {
var state_12 = _loop_12(x);
if (state_12 === "break") break;
if (state_12 === "continue") continue;
switch(state_12) {
case "break-l00_c": break l00_c;
case "continue-l00_c": continue l00_c;
}
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1_c";
}
};
l1_c: for (var x = 0; x < 1;) {
var state_13 = _loop_13(x);
if (state_13 === "break") break;
if (state_13 === "continue") continue;
switch(state_13) {
case "break-l1_c": break l1_c;
case "continue-l1_c": continue l1_c;
}
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l2_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l2_c";
}
};
l2_c: while (1 === 1) {
var state_14 = _loop_14();
if (state_14 === "break") break;
if (state_14 === "continue") continue;
switch(state_14) {
case "break-l2_c": break l2_c;
case "continue-l2_c": continue l2_c;
}
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l3_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l3_c";
}
};
l3_c: do {
var state_15 = _loop_15();
if (state_15 === "break") break;
if (state_15 === "continue") continue;
switch(state_15) {
case "break-l3_c": break l3_c;
case "continue-l3_c": continue l3_c;
}
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l4_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l4_c";
}
};
l4_c: for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (state_16 === "break") break;
if (state_16 === "continue") continue;
switch(state_16) {
case "break-l4_c": break l4_c;
case "continue-l4_c": continue l4_c;
}
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l5_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l5_c";
}
};
l5_c: for (var x = 0, y = 1; x < 1;) {
var state_17 = _loop_17(x, y);
if (state_17 === "break") break;
if (state_17 === "continue") continue;
switch(state_17) {
case "break-l5_c": break l5_c;
case "continue-l5_c": continue l5_c;
}
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l6_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l6_c";
}
};
l6_c: while (1 === 1) {
var state_18 = _loop_18();
if (state_18 === "break") break;
if (state_18 === "continue") continue;
switch(state_18) {
case "break-l6_c": break l6_c;
case "continue-l6_c": continue l6_c;
}
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l7_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l7_c";
}
};
l7_c: do {
var state_19 = _loop_19();
if (state_19 === "break") break;
if (state_19 === "continue") continue;
switch(state_19) {
case "break-l7_c": break l7_c;
case "continue-l7_c": continue l7_c;
}
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l8_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l8_c";
}
};
l8_c: for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (state_20 === "break") break;
if (state_20 === "continue") continue;
switch(state_20) {
case "break-l8_c": break l8_c;
case "continue-l8_c": continue l8_c;
}
}
@@ -0,0 +1,698 @@
=== tests/cases/compiler/capturedLetConstInLoop7.ts ===
//===let
l0:
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
break l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
continue l0;
}
}
l00:
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
break l00;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
continue l1;
}
}
l2:
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
break l2;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
continue l2;
}
}
l3:
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
break l3;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
break l4;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
break l5;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
break l6;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
continue l6;
}
}
l7:
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
break l7;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
break l8;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
break l0_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
continue l0_c;
}
}
l00_c:
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
break l00_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
break l1_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
break l2_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
continue l2_c;
}
}
l3_c:
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
break l3_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 282, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 282, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
break l4_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
break l5_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
break l6_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
break l7_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
break l8_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
continue l8_c;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,712 @@
//// [capturedLetConstInLoop7_ES6.ts]
//===let
l0:
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00:
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2:
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3:
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7:
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c:
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c:
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}
//// [capturedLetConstInLoop7_ES6.js]
//===let
l0: for (let x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00: for (let x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1: for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2: while (1 === 1) {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3: do {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1);
l4: for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5: for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6: while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7: do {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1);
l8: for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c: for (const x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c: for (const x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c: for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c: while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c: do {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1);
l4_c: for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c: for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c: while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c: do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1);
l8_c: for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}
@@ -0,0 +1,698 @@
=== tests/cases/compiler/capturedLetConstInLoop7_ES6.ts ===
//===let
l0:
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
break l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
continue l0;
}
}
l00:
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
break l00;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
continue l1;
}
}
l2:
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
break l2;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
continue l2;
}
}
l3:
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
break l3;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
break l4;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
break l5;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
break l6;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
continue l6;
}
}
l7:
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
break l7;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
break l8;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
break l0_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
continue l0_c;
}
}
l00_c:
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
break l00_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
break l1_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
break l2_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
continue l2_c;
}
}
l3_c:
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
break l3_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 282, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 282, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
break l4_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
break l5_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
break l6_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
break l7_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
break l8_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
continue l8_c;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,293 @@
//// [capturedLetConstInLoop8.ts]
function foo() {
l0:
for (let z = 0; z < 1; ++z) {
l1:
for (let x = 0; x < 1; ++x) {
ll1:
for (let y = 0; y < 1; ++y) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0:
for (const z = 0; z < 1;) {
l1:
for (const x = 0; x < 1;) {
ll1:
for (const y = 0; y < 1;) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
//// [capturedLetConstInLoop8.js]
function foo() {
l0: for (var z = 0; z < 1; ++z) {
var _loop_1 = function(x) {
var _loop_2 = function(y) {
(function () { return x + y; });
(function () { return x + y; });
if (y == 1) {
return "break";
}
if (y == 1) {
return "break-l1";
}
if (y == 1) {
return "break-ll1";
}
if (y == 1) {
return "continue-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-ll1";
}
if (x == 2) {
return { value: "123" };
}
if (x == 3) {
return { value: void 0 };
}
};
ll1: for (var y = 0; y < 1; ++y) {
var state_1 = _loop_2(y);
if (typeof state_1 === "object") return state_1;
if (state_1 === "break") break;
if (state_1 === "continue") continue;
switch(state_1) {
case "break-l1": return state_1;
case "break-ll1": break ll1;
case "continue-l0": return state_1;
case "continue-l1": return state_1;
case "continue-ll1": continue ll1;
}
}
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-l0";
}
if (x == 2) {
return { value: "456" };
}
if (x == 3) {
return { value: void 0 };
}
};
l1: for (var x = 0; x < 1; ++x) {
var state_2 = _loop_1(x);
if (typeof state_2 === "object") return state_2.value
if (state_2 === "break") break;
if (state_2 === "continue") continue;
switch(state_2) {
case "break-l1": break l1;
case "continue-l0": continue l0;
case "continue-l1": continue l1;
}
}
}
}
function foo_c() {
l0: for (var z = 0; z < 1;) {
var _loop_3 = function(x) {
var _loop_4 = function(y) {
(function () { return x + y; });
(function () { return x + y; });
if (y == 1) {
return "break";
}
if (y == 1) {
return "break-l1";
}
if (y == 1) {
return "break-ll1";
}
if (y == 1) {
return "continue-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-ll1";
}
if (x == 2) {
return { value: "123" };
}
if (x == 3) {
return { value: void 0 };
}
};
ll1: for (var y = 0; y < 1;) {
var state_3 = _loop_4(y);
if (typeof state_3 === "object") return state_3;
if (state_3 === "break") break;
if (state_3 === "continue") continue;
switch(state_3) {
case "break-l1": return state_3;
case "break-ll1": break ll1;
case "continue-l0": return state_3;
case "continue-l1": return state_3;
case "continue-ll1": continue ll1;
}
}
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-l0";
}
if (x == 2) {
return { value: "456" };
}
if (x == 3) {
return { value: void 0 };
}
};
l1: for (var x = 0; x < 1;) {
var state_4 = _loop_3(x);
if (typeof state_4 === "object") return state_4.value
if (state_4 === "break") break;
if (state_4 === "continue") continue;
switch(state_4) {
case "break-l1": break l1;
case "continue-l0": continue l0;
case "continue-l1": continue l1;
}
}
}
}
@@ -0,0 +1,228 @@
=== tests/cases/compiler/capturedLetConstInLoop8.ts ===
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop8.ts, 0, 0))
l0:
for (let z = 0; z < 1; ++z) {
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
ll1:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return;
}
}
}
}
function foo_c() {
>foo_c : Symbol(foo_c, Decl(capturedLetConstInLoop8.ts, 61, 1))
l0:
for (const z = 0; z < 1;) {
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 65, 14))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 65, 14))
l1:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
ll1:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return;
}
}
}
}
@@ -0,0 +1,357 @@
=== tests/cases/compiler/capturedLetConstInLoop8.ts ===
function foo() {
>foo : () => string
l0:
>l0 : any
for (let z = 0; z < 1; ++z) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
>++z : number
>z : number
l1:
>l1 : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
ll1:
>ll1 : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
function foo_c() {
>foo_c : () => string
l0:
>l0 : any
for (const z = 0; z < 1;) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
l1:
>l1 : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
ll1:
>ll1 : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
@@ -0,0 +1,245 @@
//// [capturedLetConstInLoop8_ES6.ts]
function foo() {
l0:
for (let z = 0; z < 1; ++z) {
l1:
for (let x = 0; x < 1; ++x) {
ll1:
for (let y = 0; y < 1; ++y) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0:
for (const z = 0; z < 1;) {
l1:
for (const x = 0; x < 1;) {
ll1:
for (const y = 0; y < 1;) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
//// [capturedLetConstInLoop8_ES6.js]
function foo() {
l0: for (let z = 0; z < 1; ++z) {
l1: for (let x = 0; x < 1; ++x) {
ll1: for (let y = 0; y < 1; ++y) {
(function () { return x + y; });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123";
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0: for (const z = 0; z < 1;) {
l1: for (const x = 0; x < 1;) {
ll1: for (const y = 0; y < 1;) {
(function () { return x + y; });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123";
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
@@ -0,0 +1,228 @@
=== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts ===
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop8_ES6.ts, 0, 0))
l0:
for (let z = 0; z < 1; ++z) {
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
ll1:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return;
}
}
}
}
function foo_c() {
>foo_c : Symbol(foo_c, Decl(capturedLetConstInLoop8_ES6.ts, 61, 1))
l0:
for (const z = 0; z < 1;) {
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 65, 14))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 65, 14))
l1:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
ll1:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return;
}
}
}
}
@@ -0,0 +1,357 @@
=== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts ===
function foo() {
>foo : () => string
l0:
>l0 : any
for (let z = 0; z < 1; ++z) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
>++z : number
>z : number
l1:
>l1 : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
ll1:
>ll1 : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
function foo_c() {
>foo_c : () => string
l0:
>l0 : any
for (const z = 0; z < 1;) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
l1:
>l1 : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
ll1:
>ll1 : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
@@ -0,0 +1,296 @@
//// [capturedLetConstInLoop9.ts]
for (let x = 0; x < 1; ++x) {
let x;
(function() { return x });
{
let x;
(function() { return x });
}
try { }
catch (e) {
let x;
(function() { return x });
}
switch (x) {
case 1:
let x;
(function() { return x });
break;
}
while (1 == 1) {
let x;
(function() { return x });
}
class A {
m() {
return x + 1;
}
}
}
declare function use(a: any);
function foo() {
l0:
for (let a of []) {
if (a === 1) {
break;
}
if (a === 2) {
break l0;
}
for (let b of []) {
var [{x, y:z}] = [{x:1, y:2}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
l1:
if (b === 3) {
break l1;
}
return 50;
}
for (let b of []) {
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
return 100;
() => b
}
() => a;
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (let x of []) {
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch(x) {
case 1: break;
case 2: continue;
}
for (let y of []) {
switch(y) {
case 1: break;
case 2: continue;
}
}
}
}
class C {
constructor(private N: number) { }
foo() {
for (let i = 0; i < 100; i++) {
let f = () => this.N * i;
}
}
}
function foo3 () {
let x = arguments.length;
for (let y of []) {
let z = arguments.length;
(function() { return y + z + arguments.length; });
}
}
//// [capturedLetConstInLoop9.js]
var _loop_1 = function(x) {
var x_1 = void 0;
(function () { return x_1; });
{
var x_2 = void 0;
(function () { return x_2; });
}
try { }
catch (e) {
var x_3 = void 0;
(function () { return x_3; });
}
switch (x_1) {
case 1:
var x_4 = void 0;
(function () { return x_4; });
break;
}
var _loop_2 = function() {
var x_5 = void 0;
(function () { return x_5; });
};
while (1 == 1) {
_loop_2();
}
var A = (function () {
function A() {
}
A.prototype.m = function () {
return x_1 + 1;
};
return A;
})();
};
for (var x = 0; x < 1; ++x) {
_loop_1(x);
}
function foo() {
var _loop_3 = function(a) {
if (a === 1) {
return "break";
}
if (a === 2) {
return "break-l0";
}
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var b = _a[_i];
_b = [{ x: 1, y: 2 }][0], x = _b.x, z = _b.y;
if (b === 1) {
break;
}
if (b === 2) {
return "break-l0";
}
l1: if (b === 3) {
break l1;
}
return { value: 50 };
}
var _loop_4 = function(b) {
_c = [{ x1: 1, y: arguments_1.length }][0], x1 = _c.x1, z1 = _c.y;
if (b === 1) {
return "break";
}
if (b === 2) {
return "break-l0";
}
return { value: 100 };
(function () { return b; });
};
for (var _d = 0, _e = []; _d < _e.length; _d++) {
var b = _e[_d];
var state_3 = _loop_4(b);
if (typeof state_3 === "object") return state_3;
if (state_3 === "break") break;
switch(state_3) {
case "break-l0": return state_3;
}
}
(function () { return a; });
};
var arguments_1 = arguments;
var x, z, x1, z1;
l0: for (var _f = 0, _g = []; _f < _g.length; _f++) {
var a = _g[_f];
var state_4 = _loop_3(a);
if (typeof state_4 === "object") return state_4.value
if (state_4 === "break") break;
switch(state_4) {
case "break-l0": break l0;
}
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch (x) {
case 1: break;
case 2: continue;
}
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var y = _c[_b];
switch (y) {
case 1: break;
case 2: continue;
}
}
}
}
var C = (function () {
function C(N) {
this.N = N;
}
C.prototype.foo = function () {
var _this = this;
var _loop_5 = function(i) {
var f = function () { return _this.N * i; };
};
for (var i = 0; i < 100; i++) {
_loop_5(i);
}
};
return C;
})();
function foo3() {
var x = arguments.length;
var _loop_6 = function(y) {
var z = arguments_2.length;
(function () { return y + z + arguments.length; });
};
var arguments_2 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var y = _a[_i];
_loop_6(y);
}
}
@@ -0,0 +1,270 @@
=== tests/cases/compiler/capturedLetConstInLoop9.ts ===
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
{
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 4, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 4, 11))
}
try { }
catch (e) {
>e : Symbol(e, Decl(capturedLetConstInLoop9.ts, 9, 11))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 10, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 10, 11))
}
switch (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
case 1:
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 16, 15))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 16, 15))
break;
}
while (1 == 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 22, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 22, 11))
}
class A {
>A : Symbol(A, Decl(capturedLetConstInLoop9.ts, 24, 5))
m() {
>m : Symbol(m, Decl(capturedLetConstInLoop9.ts, 26, 13))
return x + 1;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
}
}
}
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 33, 21))
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 33, 29))
l0:
for (let a of []) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
if (a === 1) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
break;
}
if (a === 2) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
break l0;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
var [{x, y:z}] = [{x:1, y:2}];
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 48, 35))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 48, 20))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 31))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 48, 35))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break l0;
}
l1:
if (b === 3) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break l1;
}
return 50;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 67, 38))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9.ts, 67, 21))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 33))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 67, 38))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
break l0;
}
return 100;
() => b
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
}
() => a;
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
}
use(x);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 18))
use(z);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 48, 20))
use(x1);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 18))
use(z1);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9.ts, 67, 21))
}
function foo2() {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 89, 1))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
if (x === 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
break;
}
else if (x === 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
continue;
}
while (1 === 1) {
if (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
break;
}
else {
continue;
}
}
switch(x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
case 1: break;
case 2: continue;
}
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
switch(y) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
case 1: break;
case 2: continue;
}
}
}
}
class C {
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
constructor(private N: number) { }
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 124, 38))
for (let i = 0; i < 100; i++) {
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
let f = () => this.N * i;
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 127, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
}
}
}
function foo3 () {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 130, 1))
let x = arguments.length;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 133, 7))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
let z = arguments.length;
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return y + z + arguments.length; });
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
}
}
@@ -0,0 +1,359 @@
=== tests/cases/compiler/capturedLetConstInLoop9.ts ===
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
{
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
try { }
catch (e) {
>e : any
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
switch (x) {
>x : any
case 1:
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
break;
}
while (1 == 1) {
>1 == 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
class A {
>A : A
m() {
>m : () => any
return x + 1;
>x + 1 : any
>x : any
>1 : number
}
}
}
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo() {
>foo : () => number
l0:
>l0 : any
for (let a of []) {
>a : any
>[] : undefined[]
if (a === 1) {
>a === 1 : boolean
>a : any
>1 : number
break;
}
if (a === 2) {
>a === 2 : boolean
>a : any
>2 : number
break l0;
>l0 : any
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x, y:z}] = [{x:1, y:2}];
>x : number
>y : any
>z : number
>[{x:1, y:2}] : [{ x: number; y: number; }]
>{x:1, y:2} : { x: number; y: number; }
>x : number
>1 : number
>y : number
>2 : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
l1:
>l1 : any
if (b === 3) {
>b === 3 : boolean
>b : any
>3 : number
break l1;
>l1 : any
}
return 50;
>50 : number
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : number
>y : any
>z1 : number
>[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }]
>{x1:1, y:arguments.length} : { x1: number; y: number; }
>x1 : number
>1 : number
>y : number
>arguments.length : number
>arguments : IArguments
>length : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
return 100;
>100 : number
() => b
>() => b : () => any
>b : any
}
() => a;
>() => a : () => any
>a : any
}
use(x);
>use(x) : any
>use : (a: any) => any
>x : number
use(z);
>use(z) : any
>use : (a: any) => any
>z : number
use(x1);
>use(x1) : any
>use : (a: any) => any
>x1 : number
use(z1);
>use(z1) : any
>use : (a: any) => any
>z1 : number
}
function foo2() {
>foo2 : () => void
for (let x of []) {
>x : any
>[] : undefined[]
if (x === 1) {
>x === 1 : boolean
>x : any
>1 : number
break;
}
else if (x === 2) {
>x === 2 : boolean
>x : any
>2 : number
continue;
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
if (x) {
>x : any
break;
}
else {
continue;
}
}
switch(x) {
>x : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
for (let y of []) {
>y : any
>[] : undefined[]
switch(y) {
>y : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
}
}
}
class C {
>C : C
constructor(private N: number) { }
>N : number
foo() {
>foo : () => void
for (let i = 0; i < 100; i++) {
>i : number
>0 : number
>i < 100 : boolean
>i : number
>100 : number
>i++ : number
>i : number
let f = () => this.N * i;
>f : () => number
>() => this.N * i : () => number
>this.N * i : number
>this.N : number
>this : this
>N : number
>i : number
}
}
}
function foo3 () {
>foo3 : () => void
let x = arguments.length;
>x : number
>arguments.length : number
>arguments : IArguments
>length : number
for (let y of []) {
>y : any
>[] : undefined[]
let z = arguments.length;
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return y + z + arguments.length; });
>(function() { return y + z + arguments.length; }) : () => any
>function() { return y + z + arguments.length; } : () => any
>y + z + arguments.length : any
>y + z : any
>y : any
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
}
}

Some files were not shown because too many files have changed in this diff Show More