Merge pull request #6553 from Microsoft/handleNestedBlockScopedName

handle block scoped binding in nested blocks
This commit is contained in:
Vladimir Matveev 2016-01-27 11:28:59 -08:00
parent a5a9655e87
commit 16d4039a12
78 changed files with 4636 additions and 121 deletions

View File

@ -7156,7 +7156,7 @@ namespace ts {
checkCollisionWithCapturedSuperVariable(node, node);
checkCollisionWithCapturedThisVariable(node, node);
checkBlockScopedBindingCapturedInLoop(node, symbol);
checkNestedBlockScopedBinding(node, symbol);
return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node);
}
@ -7173,7 +7173,7 @@ namespace ts {
return false;
}
function checkBlockScopedBindingCapturedInLoop(node: Identifier, symbol: Symbol): void {
function checkNestedBlockScopedBinding(node: Identifier, symbol: Symbol): void {
if (languageVersion >= ScriptTarget.ES6 ||
(symbol.flags & (SymbolFlags.BlockScopedVariable | SymbolFlags.Class)) === 0 ||
symbol.valueDeclaration.parent.kind === SyntaxKind.CatchClause) {
@ -7185,40 +7185,31 @@ namespace ts {
// 2. walk from the declaration up to the boundary of lexical environment and check
// if there is an iteration statement in between declaration and boundary (is binding/class declared inside iteration statement)
let container: Node;
if (symbol.flags & SymbolFlags.Class) {
// get parent of class declaration
container = getClassLikeDeclarationOfSymbol(symbol).parent;
}
else {
// nesting structure:
// (variable declaration or binding element) -> variable declaration list -> container
container = symbol.valueDeclaration;
while (container.kind !== SyntaxKind.VariableDeclarationList) {
container = container.parent;
}
// get the parent of variable declaration list
container = container.parent;
if (container.kind === SyntaxKind.VariableStatement) {
// if parent is variable statement - get its parent
container = container.parent;
}
}
const inFunction = isInsideFunction(node.parent, container);
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
const usedInFunction = isInsideFunction(node.parent, container);
let current = container;
let containedInIterationStatement = false;
while (current && !nodeStartsNewLexicalEnvironment(current)) {
if (isIterationStatement(current, /*lookInLabeledStatements*/ false)) {
if (inFunction) {
getNodeLinks(current).flags |= NodeCheckFlags.LoopWithBlockScopedBindingCapturedInFunction;
}
// mark value declaration so during emit they can have a special handling
getNodeLinks(<VariableDeclaration>symbol.valueDeclaration).flags |= NodeCheckFlags.BlockScopedBindingInLoop;
containedInIterationStatement = true;
break;
}
current = current.parent;
}
if (containedInIterationStatement) {
if (usedInFunction) {
// mark iteration statement as containing block-scoped binding captured in some function
getNodeLinks(current).flags |= NodeCheckFlags.LoopWithCapturedBlockScopedBinding;
}
// set 'declared inside loop' bit on the block-scoped binding
getNodeLinks(symbol.valueDeclaration).flags |= NodeCheckFlags.BlockScopedBindingInLoop;
}
if (usedInFunction) {
getNodeLinks(symbol.valueDeclaration).flags |= NodeCheckFlags.CapturedBlockScopedBinding;
}
}
function captureLexicalThis(node: Node, container: Node): void {
@ -15623,42 +15614,61 @@ namespace ts {
return symbol && symbol.flags & SymbolFlags.Alias ? getDeclarationOfAliasSymbol(symbol) : undefined;
}
function isStatementWithLocals(node: Node) {
switch (node.kind) {
case SyntaxKind.Block:
case SyntaxKind.CaseBlock:
case SyntaxKind.ForStatement:
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement:
return true;
}
return false;
}
function isNestedRedeclarationSymbol(symbol: Symbol): boolean {
function isSymbolOfDeclarationWithCollidingName(symbol: Symbol): boolean {
if (symbol.flags & SymbolFlags.BlockScoped) {
const links = getSymbolLinks(symbol);
if (links.isNestedRedeclaration === undefined) {
if (links.isDeclaratonWithCollidingName === undefined) {
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
links.isNestedRedeclaration = isStatementWithLocals(container) &&
!!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
if (isStatementWithLocals(container)) {
const nodeLinks = getNodeLinks(symbol.valueDeclaration);
if (!!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined)) {
// redeclaration - always should be renamed
links.isDeclaratonWithCollidingName = true;
}
else if (nodeLinks.flags & NodeCheckFlags.CapturedBlockScopedBinding) {
// binding is captured in the function
// should be renamed if:
// - binding is not top level - top level bindings never collide with anything
// AND
// - binding is not declared in loop, should be renamed to avoid name reuse across siblings
// let a, b
// { let x = 1; a = () => x; }
// { let x = 100; b = () => x; }
// console.log(a()); // should print '1'
// console.log(b()); // should print '100'
// OR
// - binding is declared inside loop but not in inside initializer of iteration statement or directly inside loop body
// * variables from initializer are passed to rewritted loop body as parameters so they are not captured directly
// * variables that are declared immediately in loop body will become top level variable after loop is rewritten and thus
// they will not collide with anything
const isDeclaredInLoop = nodeLinks.flags & NodeCheckFlags.BlockScopedBindingInLoop;
const inLoopInitializer = isIterationStatement(container, /*lookInLabeledStatements*/ false);
const inLoopBodyBlock = container.kind === SyntaxKind.Block && isIterationStatement(container.parent, /*lookInLabeledStatements*/ false);
links.isDeclaratonWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
links.isDeclaratonWithCollidingName = false;
}
}
}
return links.isNestedRedeclaration;
return links.isDeclaratonWithCollidingName;
}
return false;
}
// When resolved as an expression identifier, if the given node references a nested block scoped entity with
// a name that hides an existing name, return the declaration of that entity. Otherwise, return undefined.
function getReferencedNestedRedeclaration(node: Identifier): Declaration {
// a name that either hides an existing name or might hide it when compiled downlevel,
// return the declaration of that entity. Otherwise, return undefined.
function getReferencedDeclarationWithCollidingName(node: Identifier): Declaration {
const symbol = getReferencedValueSymbol(node);
return symbol && isNestedRedeclarationSymbol(symbol) ? symbol.valueDeclaration : undefined;
return symbol && isSymbolOfDeclarationWithCollidingName(symbol) ? symbol.valueDeclaration : undefined;
}
// Return true if the given node is a declaration of a nested block scoped entity with a name that hides an
// existing name.
function isNestedRedeclaration(node: Declaration): boolean {
return isNestedRedeclarationSymbol(getSymbolOfNode(node));
// Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an
// existing name or might hide a name when compiled downlevel
function isDeclarationWithCollidingName(node: Declaration): boolean {
return isSymbolOfDeclarationWithCollidingName(getSymbolOfNode(node));
}
function isValueAliasDeclaration(node: Node): boolean {
@ -15859,8 +15869,8 @@ namespace ts {
return {
getReferencedExportContainer,
getReferencedImportDeclaration,
getReferencedNestedRedeclaration,
isNestedRedeclaration,
getReferencedDeclarationWithCollidingName,
isDeclarationWithCollidingName,
isValueAliasDeclaration,
hasGlobalName,
isReferencedAliasDeclaration,

View File

@ -1530,7 +1530,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}
if (languageVersion !== ScriptTarget.ES6) {
const declaration = resolver.getReferencedNestedRedeclaration(node);
const declaration = resolver.getReferencedDeclarationWithCollidingName(node);
if (declaration) {
write(getGeneratedNameForNode(declaration.name));
return;
@ -1546,7 +1546,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}
}
function isNameOfNestedRedeclaration(node: Identifier) {
function isNameOfNestedBlockScopedRedeclarationOrCapturedBinding(node: Identifier) {
if (languageVersion < ScriptTarget.ES6) {
const parent = node.parent;
switch (parent.kind) {
@ -1554,7 +1554,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
case SyntaxKind.ClassDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.VariableDeclaration:
return (<Declaration>parent).name === node && resolver.isNestedRedeclaration(<Declaration>parent);
return (<Declaration>parent).name === node && resolver.isDeclarationWithCollidingName(<Declaration>parent);
}
}
return false;
@ -1576,7 +1576,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
else if (isExpressionIdentifier(node)) {
emitExpressionIdentifier(node);
}
else if (isNameOfNestedRedeclaration(node)) {
else if (isNameOfNestedBlockScopedRedeclarationOrCapturedBinding(node)) {
write(getGeneratedNameForNode(node));
}
else if (nodeIsSynthesized(node)) {
@ -2891,7 +2891,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
function shouldConvertLoopBody(node: IterationStatement): boolean {
return languageVersion < ScriptTarget.ES6 &&
(resolver.getNodeCheckFlags(node) & NodeCheckFlags.LoopWithBlockScopedBindingCapturedInFunction) !== 0;
(resolver.getNodeCheckFlags(node) & NodeCheckFlags.LoopWithCapturedBlockScopedBinding) !== 0;
}
function emitLoop(node: IterationStatement, loopEmitter: (n: IterationStatement, convertedLoop: ConvertedLoop) => void): void {
@ -3045,7 +3045,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
function collectNames(name: Identifier | BindingPattern): void {
if (name.kind === SyntaxKind.Identifier) {
const nameText = isNameOfNestedRedeclaration(<Identifier>name) ? getGeneratedNameForNode(name) : (<Identifier>name).text;
const nameText = isNameOfNestedBlockScopedRedeclarationOrCapturedBinding(<Identifier>name) ? getGeneratedNameForNode(name) : (<Identifier>name).text;
loopParameters.push(nameText);
}
else {
@ -4065,22 +4065,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}
else {
let initializer = node.initializer;
if (!initializer && languageVersion < ScriptTarget.ES6) {
if (!initializer &&
languageVersion < ScriptTarget.ES6 &&
// for names - binding patterns that lack initializer there is no point to emit explicit initializer
// since downlevel codegen for destructuring will fail in the absence of initializer so all binding elements will say uninitialized
node.name.kind === SyntaxKind.Identifier) {
// downlevel emit for non-initialized let bindings defined in loops
// for (...) { let x; }
// should be
// 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
const isLetDefinedInLoop =
(resolver.getNodeCheckFlags(node) & NodeCheckFlags.BlockScopedBindingInLoop) &&
(getCombinedFlagsForIdentifier(<Identifier>node.name) & NodeFlags.Let);
const container = getEnclosingBlockScopeContainer(node);
const flags = resolver.getNodeCheckFlags(node);
// NOTE: default initialization should not be added to let bindings in for-in\for-of statements
if (isLetDefinedInLoop &&
node.parent.parent.kind !== SyntaxKind.ForInStatement &&
node.parent.parent.kind !== SyntaxKind.ForOfStatement) {
// nested let bindings might need to be initialized explicitly to preserve ES6 semantic
// { let x = 1; }
// { let x; } // x here should be undefined. not 1
// NOTES:
// Top level bindings never collide with anything and thus don't require explicit initialization.
// As for nested let bindings there are two cases:
// - nested let bindings that were not renamed definitely should be initialized explicitly
// { let x = 1; }
// { let x; if (some-condition) { x = 1}; if (x) { /*1*/ } }
// Without explicit initialization code in /*1*/ can be executed even if some-condition is evaluated to false
// - renaming introduces fresh name that should not collide with any existing names, however renamed bindings sometimes also should be
// explicitly initialized. One particular case: non-captured binding declared inside loop body (but not in loop initializer)
// let x;
// for (;;) {
// let x;
// }
// in downlevel codegen inner 'x' will be renamed so it won't collide with outer 'x' however it will should be reset on every iteration
// as if it was declared anew.
// * Why non-captured binding - because if loop contains block scoped binding captured in some function then loop body will be rewritten
// to have a fresh scope on every iteration so everything will just work.
// * Why loop initializer is excluded - since we've introduced a fresh name it already will be undefined.
const isCapturedInFunction = flags & NodeCheckFlags.CapturedBlockScopedBinding;
const isDeclaredInLoop = flags & NodeCheckFlags.BlockScopedBindingInLoop;
const emittedAsTopLevel =
isBlockScopedContainerTopLevel(container) ||
(isCapturedInFunction && isDeclaredInLoop && container.kind === SyntaxKind.Block && isIterationStatement(container.parent, /*lookInLabeledStatements*/ false));
const emittedAsNestedLetDeclaration =
getCombinedNodeFlags(node) & NodeFlags.Let &&
!emittedAsTopLevel;
const emitExplicitInitializer =
emittedAsNestedLetDeclaration &&
container.kind !== SyntaxKind.ForInStatement &&
container.kind !== SyntaxKind.ForOfStatement &&
(
!resolver.isDeclarationWithCollidingName(node) ||
(isDeclaredInLoop && !isCapturedInFunction && !isIterationStatement(container, /*lookInLabeledStatements*/ false))
);
if (emitExplicitInitializer) {
initializer = createVoidZero();
}
}
@ -4115,14 +4149,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}
}
function getCombinedFlagsForIdentifier(node: Identifier): NodeFlags {
if (!node.parent || (node.parent.kind !== SyntaxKind.VariableDeclaration && node.parent.kind !== SyntaxKind.BindingElement)) {
return 0;
}
return getCombinedNodeFlags(node.parent);
}
function isES6ExportedDeclaration(node: Node) {
return !!(node.flags & NodeFlags.Export) &&
modulekind === ModuleKind.ES6 &&

View File

@ -1901,8 +1901,8 @@ namespace ts {
hasGlobalName(name: string): boolean;
getReferencedExportContainer(node: Identifier): SourceFile | ModuleDeclaration | EnumDeclaration;
getReferencedImportDeclaration(node: Identifier): Declaration;
getReferencedNestedRedeclaration(node: Identifier): Declaration;
isNestedRedeclaration(node: Declaration): boolean;
getReferencedDeclarationWithCollidingName(node: Identifier): Declaration;
isDeclarationWithCollidingName(node: Declaration): boolean;
isValueAliasDeclaration(node: Node): boolean;
isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
@ -2038,7 +2038,7 @@ namespace ts {
containingType?: UnionOrIntersectionType; // Containing union or intersection type for synthetic property
resolvedExports?: SymbolTable; // Resolved exports of module
exportsChecked?: boolean; // True if exports of external module have been checked
isNestedRedeclaration?: boolean; // True if symbol is block scoped redeclaration
isDeclaratonWithCollidingName?: boolean; // True if symbol is block scoped redeclaration
bindingElement?: BindingElement; // Binding element associated with property symbol
exportsSomeValue?: boolean; // true if module exports some value (not just types)
}
@ -2064,9 +2064,10 @@ namespace ts {
// Values for enum members have been computed, and any errors have been reported for them.
EnumValuesComputed = 0x00004000,
BlockScopedBindingInLoop = 0x00008000,
LexicalModuleMergesWithClass = 0x00010000, // Instantiated lexical module declaration is merged with a previous class declaration.
LoopWithBlockScopedBindingCapturedInFunction = 0x00020000, // Loop that contains block scoped variable captured in closure
LexicalModuleMergesWithClass = 0x00008000, // Instantiated lexical module declaration is merged with a previous class declaration.
LoopWithCapturedBlockScopedBinding = 0x00010000, // Loop that contains block scoped variable captured in closure
CapturedBlockScopedBinding = 0x00020000, // Block-scoped binding that is captured in some function
BlockScopedBindingInLoop = 0x00040000, // Block-scoped binding with declaration nested inside iteration statement
}
/* @internal */

View File

@ -151,6 +151,18 @@ namespace ts {
return <SourceFile>node;
}
export function isStatementWithLocals(node: Node) {
switch (node.kind) {
case SyntaxKind.Block:
case SyntaxKind.CaseBlock:
case SyntaxKind.ForStatement:
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement:
return true;
}
return false;
}
export function getStartPositionOfLine(line: number, sourceFile: SourceFile): number {
Debug.assert(line >= 0);
return getLineStarts(sourceFile)[line];
@ -256,6 +268,13 @@ namespace ts {
((<ModuleDeclaration>node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(<ModuleDeclaration>node));
}
export function isBlockScopedContainerTopLevel(node: Node): boolean {
return node.kind === SyntaxKind.SourceFile ||
node.kind === SyntaxKind.ModuleDeclaration ||
isFunctionLike(node) ||
isFunctionBlock(node);
}
export function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean {
return !!(module.flags & NodeFlags.GlobalAugmentation);
}

View File

@ -138,7 +138,7 @@ for (var x = 0; x < 1; ++x) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
};
@ -146,7 +146,7 @@ while (1 === 1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
};
@ -169,7 +169,7 @@ for (var x = 0, y = 1; x < 1; ++x) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
};
@ -177,7 +177,7 @@ while (1 === 1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
};

View File

@ -225,7 +225,7 @@ function foo2(x) {
}
function foo3(x) {
var _loop_5 = function() {
var x_4 = void 0;
var x_4;
var a = arguments_5.length;
(function () { return x_4 + a; });
(function () { return x_4 + a; });
@ -260,7 +260,7 @@ function foo5(x) {
}
function foo6(x) {
var _loop_8 = function() {
var x_7 = void 0, y = void 0;
var x_7, y;
var a = arguments_8.length;
(function () { return x_7 + y + a; });
(function () { return x_7 + y + a; });
@ -272,7 +272,7 @@ function foo6(x) {
}
function foo7(x) {
var _loop_9 = function() {
var x_8 = void 0, y = void 0;
var x_8, y;
var a = arguments_9.length;
(function () { return x_8 + y + a; });
(function () { return x_8 + y + a; });

View File

@ -270,7 +270,7 @@ function foo2(x) {
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
var x_5;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
};
@ -307,7 +307,7 @@ function foo5(x) {
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
var x_8, y;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
@ -320,7 +320,7 @@ function foo6(x) {
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
var x_9, y;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });

View File

@ -186,7 +186,7 @@ System.register([], function(exports_1) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
var x;
v2 = x;
(function () { return x + v2; });
(function () { return x; });
@ -195,7 +195,7 @@ System.register([], function(exports_1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
var x;
v3 = x;
(function () { return x + v3; });
(function () { return x; });
@ -221,7 +221,7 @@ System.register([], function(exports_1) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
var x, y;
v6 = x;
(function () { return x + y + v6; });
(function () { return x + y; });
@ -230,7 +230,7 @@ System.register([], function(exports_1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
var x, y;
v7 = x;
(function () { return x + y + v7; });
(function () { return x + y; });

View File

@ -349,7 +349,7 @@ function foo2(x) {
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
var x_5;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
if (x_5 == 1) {
@ -398,7 +398,7 @@ function foo5(x) {
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
var x_8, y;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
@ -416,7 +416,7 @@ function foo6(x) {
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
var x_9, y;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });

View File

@ -287,7 +287,7 @@ for (var x = 0; x < 1; ++x) {
if (state_3 === "continue") continue;
}
var _loop_4 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
if (x == 1) {
@ -303,7 +303,7 @@ while (1 === 1) {
if (state_4 === "continue") continue;
}
var _loop_5 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
if (x == 1) {
@ -350,7 +350,7 @@ for (var x = 0, y = 1; x < 1; ++x) {
if (state_7 === "continue") continue;
}
var _loop_8 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
@ -366,7 +366,7 @@ while (1 === 1) {
if (state_8 === "continue") continue;
}
var _loop_9 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {

View File

@ -454,7 +454,7 @@ l1: for (var x = 0; x < 1; ++x) {
}
}
var _loop_4 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
if (x == 1) {
@ -480,7 +480,7 @@ l2: while (1 === 1) {
}
}
var _loop_5 = function() {
var x = void 0;
var x;
(function () { return x; });
(function () { return x; });
if (x == 1) {
@ -557,7 +557,7 @@ l5: for (var x = 0, y = 1; x < 1; ++x) {
}
}
var _loop_8 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
@ -583,7 +583,7 @@ l6: while (1 === 1) {
}
}
var _loop_9 = function() {
var x = void 0, y = void 0;
var x, y;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {

View File

@ -140,25 +140,25 @@ function foo3 () {
//// [capturedLetConstInLoop9.js]
var _loop_1 = function(x) {
var x_1 = void 0;
var x_1;
(function () { return x_1; });
{
var x_2 = void 0;
var x_2;
(function () { return x_2; });
}
try { }
catch (e) {
var x_3 = void 0;
var x_3;
(function () { return x_3; });
}
switch (x_1) {
case 1:
var x_4 = void 0;
var x_4;
(function () { return x_4; });
break;
}
var _loop_2 = function() {
var x_5 = void 0;
var x_5;
(function () { return x_5; });
};
while (1 == 1) {

View File

@ -367,7 +367,7 @@ var M4;
use(z);
})(M4 || (M4 = {}));
function foo3() {
for (var x_7 = void 0;;) {
for (var x_7;;) {
use(x_7);
}
for (var y_7 = [][0];;) {

View File

@ -86,7 +86,7 @@ for (;;) {
var x_4 = 10;
use(x_4);
}
for (var x_5 = void 0;;) {
for (var x_5;;) {
use(x_5);
x_5 = 1;
}

View File

@ -0,0 +1,97 @@
//// [nestedBlockScopedBindings1.ts]
function a0() {
{
let x = 1;
}
{
let x = 1;
}
}
function a1() {
{
let x;
}
{
let x = 1;
}
}
function a2() {
{
let x = 1;
}
{
let x;
}
}
function a3() {
{
let x = 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a4() {
{
let x;
}
switch (1) {
case 1:
let x = 1;
break;
}
}
//// [nestedBlockScopedBindings1.js]
function a0() {
{
var x = 1;
}
{
var x = 1;
}
}
function a1() {
{
var x = void 0;
}
{
var x = 1;
}
}
function a2() {
{
var x = 1;
}
{
var x = void 0;
}
}
function a3() {
{
var x = 1;
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a4() {
{
var x = void 0;
}
switch (1) {
case 1:
var x = 1;
break;
}
}

View File

@ -0,0 +1,68 @@
=== tests/cases/compiler/nestedBlockScopedBindings1.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings1.ts, 0, 0))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 2, 11))
}
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 5, 11))
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings1.ts, 7, 1))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 11, 11))
}
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 14, 11))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings1.ts, 16, 1))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 20, 11))
}
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 23, 11))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings1.ts, 25, 1))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 29, 11))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 33, 15))
break;
}
}
function a4() {
>a4 : Symbol(a4, Decl(nestedBlockScopedBindings1.ts, 36, 1))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 41, 11))
}
switch (1) {
case 1:
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings1.ts, 45, 15))
break;
}
}

View File

@ -0,0 +1,82 @@
=== tests/cases/compiler/nestedBlockScopedBindings1.ts ===
function a0() {
>a0 : () => void
{
let x = 1;
>x : number
>1 : number
}
{
let x = 1;
>x : number
>1 : number
}
}
function a1() {
>a1 : () => void
{
let x;
>x : any
}
{
let x = 1;
>x : number
>1 : number
}
}
function a2() {
>a2 : () => void
{
let x = 1;
>x : number
>1 : number
}
{
let x;
>x : any
}
}
function a3() {
>a3 : () => void
{
let x = 1;
>x : number
>1 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a4() {
>a4 : () => void
{
let x;
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x = 1;
>x : number
>1 : number
break;
}
}

View File

@ -0,0 +1,24 @@
//// [nestedBlockScopedBindings10.ts]
{
let x;
x = 1;
}
switch (1) {
case 1:
let y;
y = 1;
break;
}
//// [nestedBlockScopedBindings10.js]
{
var x = void 0;
x = 1;
}
switch (1) {
case 1:
var y = void 0;
y = 1;
break;
}

View File

@ -0,0 +1,19 @@
=== tests/cases/compiler/nestedBlockScopedBindings10.ts ===
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings10.ts, 1, 7))
x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings10.ts, 1, 7))
}
switch (1) {
case 1:
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings10.ts, 7, 11))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings10.ts, 7, 11))
break;
}

View File

@ -0,0 +1,27 @@
=== tests/cases/compiler/nestedBlockScopedBindings10.ts ===
{
let x;
>x : any
x = 1;
>x = 1 : number
>x : any
>1 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
break;
}

View File

@ -0,0 +1,28 @@
//// [nestedBlockScopedBindings11.ts]
var x;
{
let x;
() => x;
}
var y;
switch (1) {
case 1:
let y;
() => y;
break;
}
//// [nestedBlockScopedBindings11.js]
var x;
{
var x_1;
(function () { return x_1; });
}
var y;
switch (1) {
case 1:
var y_1;
(function () { return y_1; });
break;
}

View File

@ -0,0 +1,24 @@
=== tests/cases/compiler/nestedBlockScopedBindings11.ts ===
var x;
>x : Symbol(x, Decl(nestedBlockScopedBindings11.ts, 0, 3))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings11.ts, 2, 7))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings11.ts, 2, 7))
}
var y;
>y : Symbol(y, Decl(nestedBlockScopedBindings11.ts, 6, 3))
switch (1) {
case 1:
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings11.ts, 9, 11))
() => y;
>y : Symbol(y, Decl(nestedBlockScopedBindings11.ts, 9, 11))
break;
}

View File

@ -0,0 +1,30 @@
=== tests/cases/compiler/nestedBlockScopedBindings11.ts ===
var x;
>x : any
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
var y;
>y : any
switch (1) {
>1 : number
case 1:
>1 : number
let y;
>y : any
() => y;
>() => y : () => any
>y : any
break;
}

View File

@ -0,0 +1,28 @@
//// [nestedBlockScopedBindings12.ts]
var x;
{
let x;
x = 1;
}
var y;
switch (1) {
case 1:
let y;
y = 1;
break;
}
//// [nestedBlockScopedBindings12.js]
var x;
{
var x_1;
x_1 = 1;
}
var y;
switch (1) {
case 1:
var y_1;
y_1 = 1;
break;
}

View File

@ -0,0 +1,24 @@
=== tests/cases/compiler/nestedBlockScopedBindings12.ts ===
var x;
>x : Symbol(x, Decl(nestedBlockScopedBindings12.ts, 0, 3))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings12.ts, 2, 7))
x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings12.ts, 2, 7))
}
var y;
>y : Symbol(y, Decl(nestedBlockScopedBindings12.ts, 6, 3))
switch (1) {
case 1:
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings12.ts, 9, 11))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings12.ts, 9, 11))
break;
}

View File

@ -0,0 +1,32 @@
=== tests/cases/compiler/nestedBlockScopedBindings12.ts ===
var x;
>x : any
{
let x;
>x : any
x = 1;
>x = 1 : number
>x : any
>1 : number
}
var y;
>y : any
switch (1) {
>1 : number
case 1:
>1 : number
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
break;
}

View File

@ -0,0 +1,23 @@
//// [nestedBlockScopedBindings13.ts]
for (; false;) {
let x;
() => x;
}
for (; false;) {
let y;
y = 1;
}
//// [nestedBlockScopedBindings13.js]
var _loop_1 = function() {
var x;
(function () { return x; });
};
for (; false;) {
_loop_1();
}
for (; false;) {
var y = void 0;
y = 1;
}

View File

@ -0,0 +1,16 @@
=== tests/cases/compiler/nestedBlockScopedBindings13.ts ===
for (; false;) {
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings13.ts, 1, 7))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings13.ts, 1, 7))
}
for (; false;) {
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings13.ts, 6, 7))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings13.ts, 6, 7))
}

View File

@ -0,0 +1,23 @@
=== tests/cases/compiler/nestedBlockScopedBindings13.ts ===
for (; false;) {
>false : boolean
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
for (; false;) {
>false : boolean
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
}

View File

@ -0,0 +1,27 @@
//// [nestedBlockScopedBindings14.ts]
var x;
for (; false;) {
let x;
() => x;
}
var y;
for (; false;) {
let y;
y = 1;
}
//// [nestedBlockScopedBindings14.js]
var x;
var _loop_1 = function() {
var x_1;
(function () { return x_1; });
};
for (; false;) {
_loop_1();
}
var y;
for (; false;) {
var y_1 = void 0;
y_1 = 1;
}

View File

@ -0,0 +1,22 @@
=== tests/cases/compiler/nestedBlockScopedBindings14.ts ===
var x;
>x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 0, 3))
for (; false;) {
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 2, 7))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 2, 7))
}
var y;
>y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 6, 3))
for (; false;) {
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 8, 7))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 8, 7))
}

View File

@ -0,0 +1,29 @@
=== tests/cases/compiler/nestedBlockScopedBindings14.ts ===
var x;
>x : any
for (; false;) {
>false : boolean
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
var y;
>y : any
for (; false;) {
>false : boolean
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
}

View File

@ -0,0 +1,68 @@
//// [nestedBlockScopedBindings15.ts]
for (; false;) {
{
let x;
() => x;
}
}
for (; false;) {
{
let y;
y = 1;
}
}
for (; false;) {
switch (1){
case 1:
let z0;
() => z0;
break;
}
}
for (; false;) {
switch (1){
case 1:
let z;
z = 1;
break;
}
}
//// [nestedBlockScopedBindings15.js]
var _loop_1 = function() {
{
var x_1;
(function () { return x_1; });
}
};
for (; false;) {
_loop_1();
}
for (; false;) {
{
var y = void 0;
y = 1;
}
}
var _loop_2 = function() {
switch (1) {
case 1:
var z0_1;
(function () { return z0_1; });
break;
}
};
for (; false;) {
_loop_2();
}
for (; false;) {
switch (1) {
case 1:
var z = void 0;
z = 1;
break;
}
}

View File

@ -0,0 +1,46 @@
=== tests/cases/compiler/nestedBlockScopedBindings15.ts ===
for (; false;) {
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings15.ts, 2, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings15.ts, 2, 11))
}
}
for (; false;) {
{
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings15.ts, 9, 11))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings15.ts, 9, 11))
}
}
for (; false;) {
switch (1){
case 1:
let z0;
>z0 : Symbol(z0, Decl(nestedBlockScopedBindings15.ts, 17, 15))
() => z0;
>z0 : Symbol(z0, Decl(nestedBlockScopedBindings15.ts, 17, 15))
break;
}
}
for (; false;) {
switch (1){
case 1:
let z;
>z : Symbol(z, Decl(nestedBlockScopedBindings15.ts, 26, 15))
z = 1;
>z : Symbol(z, Decl(nestedBlockScopedBindings15.ts, 26, 15))
break;
}
}

View File

@ -0,0 +1,66 @@
=== tests/cases/compiler/nestedBlockScopedBindings15.ts ===
for (; false;) {
>false : boolean
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
}
for (; false;) {
>false : boolean
{
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
}
}
for (; false;) {
>false : boolean
switch (1){
>1 : number
case 1:
>1 : number
let z0;
>z0 : any
() => z0;
>() => z0 : () => any
>z0 : any
break;
}
}
for (; false;) {
>false : boolean
switch (1){
>1 : number
case 1:
>1 : number
let z;
>z : any
z = 1;
>z = 1 : number
>z : any
>1 : number
break;
}
}

View File

@ -0,0 +1,76 @@
//// [nestedBlockScopedBindings16.ts]
var x;
for (; false;) {
{
let x;
() => x;
}
}
var y;
for (; false;) {
{
let y;
y = 1;
}
}
var z0;
for (; false;) {
switch (1){
case 1:
let z0;
() => z0;
break;
}
}
var z;
for (; false;) {
switch (1){
case 1:
let z;
z = 1;
break;
}
}
//// [nestedBlockScopedBindings16.js]
var x;
var _loop_1 = function() {
{
var x_1;
(function () { return x_1; });
}
};
for (; false;) {
_loop_1();
}
var y;
for (; false;) {
{
var y_1 = void 0;
y_1 = 1;
}
}
var z0;
var _loop_2 = function() {
switch (1) {
case 1:
var z0_1;
(function () { return z0_1; });
break;
}
};
for (; false;) {
_loop_2();
}
var z;
for (; false;) {
switch (1) {
case 1:
var z_1 = void 0;
z_1 = 1;
break;
}
}

View File

@ -0,0 +1,58 @@
=== tests/cases/compiler/nestedBlockScopedBindings16.ts ===
var x;
>x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 0, 3))
for (; false;) {
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 3, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 3, 11))
}
}
var y;
>y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 8, 3))
for (; false;) {
{
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 11, 11))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 11, 11))
}
}
var z0;
>z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 16, 3))
for (; false;) {
switch (1){
case 1:
let z0;
>z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 20, 15))
() => z0;
>z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 20, 15))
break;
}
}
var z;
>z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 26, 3))
for (; false;) {
switch (1){
case 1:
let z;
>z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 30, 15))
z = 1;
>z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 30, 15))
break;
}
}

View File

@ -0,0 +1,78 @@
=== tests/cases/compiler/nestedBlockScopedBindings16.ts ===
var x;
>x : any
for (; false;) {
>false : boolean
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
}
var y;
>y : any
for (; false;) {
>false : boolean
{
let y;
>y : any
y = 1;
>y = 1 : number
>y : any
>1 : number
}
}
var z0;
>z0 : any
for (; false;) {
>false : boolean
switch (1){
>1 : number
case 1:
>1 : number
let z0;
>z0 : any
() => z0;
>() => z0 : () => any
>z0 : any
break;
}
}
var z;
>z : any
for (; false;) {
>false : boolean
switch (1){
>1 : number
case 1:
>1 : number
let z;
>z : any
z = 1;
>z = 1 : number
>z : any
>1 : number
break;
}
}

View File

@ -0,0 +1,244 @@
//// [nestedBlockScopedBindings2.ts]
function a0() {
{
let x = 1;
() => x;
}
{
let x = 1;
}
}
function a1() {
{
let x;
}
{
let x = 1;
() => x;
}
}
function a2() {
{
let x = 1;
() => x;
}
{
let x;
() => x;
}
}
function a3() {
{
let x = 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a4() {
{
let x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a5() {
{
let x;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a6() {
switch (1) {
case 1:
let x;
break;
}
switch (1) {
case 1:
let x;
break;
}
}
function a7() {
switch (1) {
case 1:
let x;
() => x;
break;
}
switch (1) {
case 1:
let x;
break;
}
}
function a8() {
switch (1) {
case 1:
let x;
break;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a9() {
switch (1) {
case 1:
let x;
() => x;
break;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
//// [nestedBlockScopedBindings2.js]
function a0() {
{
var x_1 = 1;
(function () { return x_1; });
}
{
var x = 1;
}
}
function a1() {
{
var x = void 0;
}
{
var x_2 = 1;
(function () { return x_2; });
}
}
function a2() {
{
var x_3 = 1;
(function () { return x_3; });
}
{
var x_4;
(function () { return x_4; });
}
}
function a3() {
{
var x_5 = 1;
(function () { return x_5; });
}
switch (1) {
case 1:
var x_6;
(function () { return x_6; });
break;
}
}
function a4() {
{
var x = void 0;
}
switch (1) {
case 1:
var x_7;
(function () { return x_7; });
break;
}
}
function a5() {
{
var x_8;
(function () { return x_8; });
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a6() {
switch (1) {
case 1:
var x = void 0;
break;
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a7() {
switch (1) {
case 1:
var x_9;
(function () { return x_9; });
break;
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a8() {
switch (1) {
case 1:
var x = void 0;
break;
}
switch (1) {
case 1:
var x_10;
(function () { return x_10; });
break;
}
}
function a9() {
switch (1) {
case 1:
var x_11;
(function () { return x_11; });
break;
}
switch (1) {
case 1:
var x_12;
(function () { return x_12; });
break;
}
}

View File

@ -0,0 +1,197 @@
=== tests/cases/compiler/nestedBlockScopedBindings2.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings2.ts, 0, 0))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 2, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 2, 11))
}
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 6, 11))
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings2.ts, 8, 1))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 12, 11))
}
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 15, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 15, 11))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings2.ts, 18, 1))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 22, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 22, 11))
}
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 26, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 26, 11))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings2.ts, 29, 1))
{
let x = 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 34, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 34, 11))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 39, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 39, 15))
break;
}
}
function a4() {
>a4 : Symbol(a4, Decl(nestedBlockScopedBindings2.ts, 43, 1))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 48, 11))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 52, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 52, 15))
break;
}
}
function a5() {
>a5 : Symbol(a5, Decl(nestedBlockScopedBindings2.ts, 56, 1))
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 61, 11))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 61, 11))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 66, 15))
break;
}
}
function a6() {
>a6 : Symbol(a6, Decl(nestedBlockScopedBindings2.ts, 69, 1))
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 74, 15))
break;
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 79, 15))
break;
}
}
function a7() {
>a7 : Symbol(a7, Decl(nestedBlockScopedBindings2.ts, 82, 1))
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 87, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 87, 15))
break;
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 93, 15))
break;
}
}
function a8() {
>a8 : Symbol(a8, Decl(nestedBlockScopedBindings2.ts, 96, 1))
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 101, 15))
break;
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 106, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 106, 15))
break;
}
}
function a9() {
>a9 : Symbol(a9, Decl(nestedBlockScopedBindings2.ts, 110, 1))
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 115, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 115, 15))
break;
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 121, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings2.ts, 121, 15))
break;
}
}

View File

@ -0,0 +1,258 @@
=== tests/cases/compiler/nestedBlockScopedBindings2.ts ===
function a0() {
>a0 : () => void
{
let x = 1;
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
{
let x = 1;
>x : number
>1 : number
}
}
function a1() {
>a1 : () => void
{
let x;
>x : any
}
{
let x = 1;
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
}
function a2() {
>a2 : () => void
{
let x = 1;
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
}
function a3() {
>a3 : () => void
{
let x = 1;
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a4() {
>a4 : () => void
{
let x;
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a5() {
>a5 : () => void
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a6() {
>a6 : () => void
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a7() {
>a7 : () => void
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a8() {
>a8 : () => void
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a9() {
>a9 : () => void
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}

View File

@ -0,0 +1,150 @@
//// [nestedBlockScopedBindings3.ts]
function a0() {
{
for (let x = 0; x < 1; ) {
() => x;
}
}
{
for (let x;;) {
() => x;
}
}
}
function a1() {
for (let x; x < 1;) {
() => x;
}
for (let x;;) {
() => x;
}
}
function a2() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a3() {
for (let x; x < 1;) {
x = x + 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a4() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a5() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
//// [nestedBlockScopedBindings3.js]
function a0() {
{
var _loop_1 = function(x) {
(function () { return x; });
};
for (var x = 0; x < 1;) {
_loop_1(x);
}
}
{
var _loop_2 = function(x) {
(function () { return x; });
};
for (var x = void 0;;) {
_loop_2(x);
}
}
}
function a1() {
var _loop_3 = function(x) {
(function () { return x; });
};
for (var x = void 0; x < 1;) {
_loop_3(x);
}
var _loop_4 = function(x) {
(function () { return x; });
};
for (var x = void 0;;) {
_loop_4(x);
}
}
function a2() {
for (var x = void 0; x < 1;) {
x = x + 1;
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a3() {
for (var x = void 0; x < 1;) {
x = x + 1;
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a4() {
var _loop_5 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x = void 0; x < 1;) {
_loop_5(x);
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a5() {
var _loop_6 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x = void 0; x < 1;) {
_loop_6(x);
}
switch (1) {
case 1:
var x_1;
(function () { return x_1; });
break;
}
}

View File

@ -0,0 +1,130 @@
=== tests/cases/compiler/nestedBlockScopedBindings3.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings3.ts, 0, 0))
{
for (let x = 0; x < 1; ) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 2, 16))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 2, 16))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 2, 16))
}
}
{
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 7, 16))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 7, 16))
}
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings3.ts, 11, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 14, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 14, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 14, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 17, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 17, 12))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings3.ts, 20, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 23, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 23, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 23, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 23, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 26, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 26, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 26, 12))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings3.ts, 29, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 33, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 33, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 33, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 33, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 38, 15))
break;
}
}
function a4() {
>a4 : Symbol(a4, Decl(nestedBlockScopedBindings3.ts, 41, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 44, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 44, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 44, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 44, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 44, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 50, 15))
break;
}
}
function a5() {
>a5 : Symbol(a5, Decl(nestedBlockScopedBindings3.ts, 53, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 57, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 57, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 57, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 57, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 57, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 63, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings3.ts, 63, 15))
break;
}
}

View File

@ -0,0 +1,177 @@
=== tests/cases/compiler/nestedBlockScopedBindings3.ts ===
function a0() {
>a0 : () => void
{
for (let x = 0; x < 1; ) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
}
{
for (let x;;) {
>x : any
() => x;
>() => x : () => any
>x : any
}
}
}
function a1() {
>a1 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
() => x;
>() => x : () => any
>x : any
}
for (let x;;) {
>x : any
() => x;
>() => x : () => any
>x : any
}
}
function a2() {
>a2 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a3() {
>a3 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a4() {
>a4 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a5() {
>a5 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}

View File

@ -0,0 +1,91 @@
//// [nestedBlockScopedBindings4.ts]
function a0() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
//// [nestedBlockScopedBindings4.js]
function a0() {
for (var x = void 0; x < 1;) {
x = x + 1;
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a1() {
var _loop_1 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x = void 0; x < 1;) {
_loop_1(x);
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a2() {
for (var x = void 0; x < 1;) {
x = x + 1;
}
var _loop_2 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0;;) {
_loop_2(x);
}
}
function a3() {
var _loop_3 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x = void 0; x < 1;) {
_loop_3(x);
}
var _loop_4 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0;;) {
_loop_4(x);
}
}

View File

@ -0,0 +1,93 @@
=== tests/cases/compiler/nestedBlockScopedBindings4.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings4.ts, 0, 0))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 1, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 1, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 1, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 1, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 4, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 4, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 4, 12))
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings4.ts, 7, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 10, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 10, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 10, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 10, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 10, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 14, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 14, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 14, 12))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings4.ts, 17, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 20, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 20, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 20, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 20, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 23, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 23, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 23, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 23, 12))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings4.ts, 27, 1))
for (let x; x < 1;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 31, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 31, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 31, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 31, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 31, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 35, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 35, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 35, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings4.ts, 35, 12))
}
}

View File

@ -0,0 +1,129 @@
=== tests/cases/compiler/nestedBlockScopedBindings4.ts ===
function a0() {
>a0 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a1() {
>a1 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
() => x;
>() => x : () => any
>x : any
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a2() {
>a2 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
}
function a3() {
>a3 : () => void
for (let x; x < 1;) {
>x : any
>x < 1 : boolean
>x : any
>1 : number
x = x + 1;
>x = x + 1 : any
>x : any
>x + 1 : any
>x : any
>1 : number
() => x;
>() => x : () => any
>x : any
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
}

View File

@ -0,0 +1,169 @@
//// [nestedBlockScopedBindings5.ts]
function a0() {
for (let x in []) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x in []) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x in []) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x in []) {
x = x + 1;
() => x;
}
for (let x;false;) {
x = x + 2;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a4() {
for (let x in []) {
x = x + 1;
}
for (let x;false;) {
x = x + 2;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a5() {
let y;
for (let x in []) {
x = x + 1;
}
for (let x;false;) {
x = x + 2;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
//// [nestedBlockScopedBindings5.js]
function a0() {
for (var x in []) {
x = x + 1;
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a1() {
var _loop_1 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x in []) {
_loop_1(x);
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a2() {
for (var x in []) {
x = x + 1;
}
var _loop_2 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0;;) {
_loop_2(x);
}
}
function a3() {
var _loop_3 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var x in []) {
_loop_3(x);
}
var _loop_4 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0; false;) {
_loop_4(x);
}
switch (1) {
case 1:
var x_1;
(function () { return x_1; });
break;
}
}
function a4() {
for (var x in []) {
x = x + 1;
}
for (var x = void 0; false;) {
x = x + 2;
}
switch (1) {
case 1:
var x_2;
(function () { return x_2; });
break;
}
}
function a5() {
var y;
for (var x in []) {
x = x + 1;
}
var _loop_5 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0; false;) {
_loop_5(x);
}
switch (1) {
case 1:
var x = void 0;
break;
}
}

View File

@ -0,0 +1,163 @@
=== tests/cases/compiler/nestedBlockScopedBindings5.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings5.ts, 0, 0))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12))
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings5.ts, 7, 1))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings5.ts, 17, 1))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings5.ts, 27, 1))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12))
}
for (let x;false;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 41, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 41, 15))
break;
}
}
function a4() {
>a4 : Symbol(a4, Decl(nestedBlockScopedBindings5.ts, 46, 1))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12))
}
for (let x;false;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 57, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 57, 15))
break;
}
}
function a5() {
>a5 : Symbol(a5, Decl(nestedBlockScopedBindings5.ts, 62, 1))
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings5.ts, 65, 7))
for (let x in []) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12))
}
for (let x;false;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 75, 15))
break;
}
}

View File

@ -0,0 +1,227 @@
=== tests/cases/compiler/nestedBlockScopedBindings5.ts ===
function a0() {
>a0 : () => void
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a1() {
>a1 : () => void
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
() => x;
>() => x : () => string
>x : string
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a2() {
>a2 : () => void
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
}
function a3() {
>a3 : () => void
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
() => x;
>() => x : () => string
>x : string
}
for (let x;false;) {
>x : any
>false : boolean
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a4() {
>a4 : () => void
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
}
for (let x;false;) {
>x : any
>false : boolean
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a5() {
>a5 : () => void
let y;
>y : any
for (let x in []) {
>x : string
>[] : undefined[]
x = x + 1;
>x = x + 1 : string
>x : string
>x + 1 : string
>x : string
>1 : number
}
for (let x;false;) {
>x : any
>false : boolean
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}

View File

@ -0,0 +1,197 @@
//// [nestedBlockScopedBindings6.ts]
function a0() {
for (let x of [1]) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x of [1]) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x of [1]) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x of [1]) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a4() {
for (let x of [1]) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a5() {
for (let x of [1]) {
x = x + 1;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a6() {
for (let x of [1]) {
x = x + 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a7() {
for (let x of [1]) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
//// [nestedBlockScopedBindings6.js]
function a0() {
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
x = x + 1;
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a1() {
var _loop_1 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
_loop_1(x);
}
for (var x = void 0;;) {
x = x + 2;
}
}
function a2() {
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
x = x + 1;
}
var _loop_2 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0;;) {
_loop_2(x);
}
}
function a3() {
var _loop_3 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
_loop_3(x);
}
var _loop_4 = function(x) {
x = x + 2;
(function () { return x; });
};
for (var x = void 0;;) {
_loop_4(x);
}
}
function a4() {
var _loop_5 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
_loop_5(x);
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a5() {
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
x = x + 1;
}
switch (1) {
case 1:
var x_1;
(function () { return x_1; });
break;
}
}
function a6() {
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
x = x + 1;
}
switch (1) {
case 1:
var x = void 0;
break;
}
}
function a7() {
var _loop_6 = function(x) {
x = x + 1;
(function () { return x; });
};
for (var _i = 0, _a = [1]; _i < _a.length; _i++) {
var x = _a[_i];
_loop_6(x);
}
switch (1) {
case 1:
var x_2;
(function () { return x_2; });
break;
}
}

View File

@ -0,0 +1,177 @@
=== tests/cases/compiler/nestedBlockScopedBindings6.ts ===
function a0() {
>a0 : Symbol(a0, Decl(nestedBlockScopedBindings6.ts, 0, 0))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 1, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 1, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 1, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 4, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 4, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 4, 12))
}
}
function a1() {
>a1 : Symbol(a1, Decl(nestedBlockScopedBindings6.ts, 7, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 10, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 10, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 10, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 10, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 14, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 14, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 14, 12))
}
}
function a2() {
>a2 : Symbol(a2, Decl(nestedBlockScopedBindings6.ts, 17, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 20, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 20, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 20, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 23, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 23, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 23, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 23, 12))
}
}
function a3() {
>a3 : Symbol(a3, Decl(nestedBlockScopedBindings6.ts, 27, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 30, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 30, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 30, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 30, 12))
}
for (let x;;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 34, 12))
x = x + 2;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 34, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 34, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 34, 12))
}
}
function a4() {
>a4 : Symbol(a4, Decl(nestedBlockScopedBindings6.ts, 38, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 41, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 41, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 41, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 41, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 47, 15))
break;
}
}
function a5() {
>a5 : Symbol(a5, Decl(nestedBlockScopedBindings6.ts, 50, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 54, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 54, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 54, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 59, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 59, 15))
break;
}
}
function a6() {
>a6 : Symbol(a6, Decl(nestedBlockScopedBindings6.ts, 63, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 66, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 66, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 66, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 71, 15))
break;
}
}
function a7() {
>a7 : Symbol(a7, Decl(nestedBlockScopedBindings6.ts, 74, 1))
for (let x of [1]) {
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 77, 12))
x = x + 1;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 77, 12))
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 77, 12))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 77, 12))
}
switch (1) {
case 1:
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 83, 15))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings6.ts, 83, 15))
break;
}
}

View File

@ -0,0 +1,253 @@
=== tests/cases/compiler/nestedBlockScopedBindings6.ts ===
function a0() {
>a0 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a1() {
>a1 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
}
}
function a2() {
>a2 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
}
function a3() {
>a3 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
for (let x;;) {
>x : any
x = x + 2;
>x = x + 2 : any
>x : any
>x + 2 : any
>x : any
>2 : number
() => x;
>() => x : () => any
>x : any
}
}
function a4() {
>a4 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a5() {
>a5 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}
function a6() {
>a6 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
break;
}
}
function a7() {
>a7 : () => void
for (let x of [1]) {
>x : number
>[1] : number[]
>1 : number
x = x + 1;
>x = x + 1 : number
>x : number
>x + 1 : number
>x : number
>1 : number
() => x;
>() => x : () => number
>x : number
}
switch (1) {
>1 : number
case 1:
>1 : number
let x;
>x : any
() => x;
>() => x : () => any
>x : any
break;
}
}

View File

@ -0,0 +1,19 @@
//// [nestedBlockScopedBindings7.ts]
for (let x; false;) {
() => x;
}
for (let y; false;) {
y = 1;
}
//// [nestedBlockScopedBindings7.js]
var _loop_1 = function(x) {
(function () { return x; });
};
for (var x = void 0; false;) {
_loop_1(x);
}
for (var y = void 0; false;) {
y = 1;
}

View File

@ -0,0 +1,14 @@
=== tests/cases/compiler/nestedBlockScopedBindings7.ts ===
for (let x; false;) {
>x : Symbol(x, Decl(nestedBlockScopedBindings7.ts, 0, 8))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings7.ts, 0, 8))
}
for (let y; false;) {
>y : Symbol(y, Decl(nestedBlockScopedBindings7.ts, 4, 8))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings7.ts, 4, 8))
}

View File

@ -0,0 +1,19 @@
=== tests/cases/compiler/nestedBlockScopedBindings7.ts ===
for (let x; false;) {
>x : any
>false : boolean
() => x;
>() => x : () => any
>x : any
}
for (let y; false;) {
>y : any
>false : boolean
y = 1;
>y = 1 : number
>y : any
>1 : number
}

View File

@ -0,0 +1,23 @@
//// [nestedBlockScopedBindings8.ts]
var x;
for (let x; false; ) {
() => x;
}
var y;
for (let y; false; ) {
y = 1;
}
//// [nestedBlockScopedBindings8.js]
var x;
var _loop_1 = function(x_1) {
(function () { return x_1; });
};
for (var x_1; false;) {
_loop_1(x_1);
}
var y;
for (var y_1; false;) {
y_1 = 1;
}

View File

@ -0,0 +1,20 @@
=== tests/cases/compiler/nestedBlockScopedBindings8.ts ===
var x;
>x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 0, 3))
for (let x; false; ) {
>x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 1, 8))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 1, 8))
}
var y;
>y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 5, 3))
for (let y; false; ) {
>y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 6, 8))
y = 1;
>y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 6, 8))
}

View File

@ -0,0 +1,25 @@
=== tests/cases/compiler/nestedBlockScopedBindings8.ts ===
var x;
>x : any
for (let x; false; ) {
>x : any
>false : boolean
() => x;
>() => x : () => any
>x : any
}
var y;
>y : any
for (let y; false; ) {
>y : any
>false : boolean
y = 1;
>y = 1 : number
>y : any
>1 : number
}

View File

@ -0,0 +1,24 @@
//// [nestedBlockScopedBindings9.ts]
{
let x;
() => x;
}
switch (1) {
case 1:
let y;
() => y;
break;
}
//// [nestedBlockScopedBindings9.js]
{
var x_1;
(function () { return x_1; });
}
switch (1) {
case 1:
var y_1;
(function () { return y_1; });
break;
}

View File

@ -0,0 +1,19 @@
=== tests/cases/compiler/nestedBlockScopedBindings9.ts ===
{
let x;
>x : Symbol(x, Decl(nestedBlockScopedBindings9.ts, 1, 7))
() => x;
>x : Symbol(x, Decl(nestedBlockScopedBindings9.ts, 1, 7))
}
switch (1) {
case 1:
let y;
>y : Symbol(y, Decl(nestedBlockScopedBindings9.ts, 7, 11))
() => y;
>y : Symbol(y, Decl(nestedBlockScopedBindings9.ts, 7, 11))
break;
}

View File

@ -0,0 +1,25 @@
=== tests/cases/compiler/nestedBlockScopedBindings9.ts ===
{
let x;
>x : any
() => x;
>() => x : () => any
>x : any
}
switch (1) {
>1 : number
case 1:
>1 : number
let y;
>y : any
() => y;
>() => y : () => any
>y : any
break;
}

View File

@ -0,0 +1,49 @@
function a0() {
{
let x = 1;
}
{
let x = 1;
}
}
function a1() {
{
let x;
}
{
let x = 1;
}
}
function a2() {
{
let x = 1;
}
{
let x;
}
}
function a3() {
{
let x = 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a4() {
{
let x;
}
switch (1) {
case 1:
let x = 1;
break;
}
}

View File

@ -0,0 +1,11 @@
{
let x;
x = 1;
}
switch (1) {
case 1:
let y;
y = 1;
break;
}

View File

@ -0,0 +1,13 @@
var x;
{
let x;
() => x;
}
var y;
switch (1) {
case 1:
let y;
() => y;
break;
}

View File

@ -0,0 +1,13 @@
var x;
{
let x;
x = 1;
}
var y;
switch (1) {
case 1:
let y;
y = 1;
break;
}

View File

@ -0,0 +1,9 @@
for (; false;) {
let x;
() => x;
}
for (; false;) {
let y;
y = 1;
}

View File

@ -0,0 +1,11 @@
var x;
for (; false;) {
let x;
() => x;
}
var y;
for (; false;) {
let y;
y = 1;
}

View File

@ -0,0 +1,31 @@
for (; false;) {
{
let x;
() => x;
}
}
for (; false;) {
{
let y;
y = 1;
}
}
for (; false;) {
switch (1){
case 1:
let z0;
() => z0;
break;
}
}
for (; false;) {
switch (1){
case 1:
let z;
z = 1;
break;
}
}

View File

@ -0,0 +1,35 @@
var x;
for (; false;) {
{
let x;
() => x;
}
}
var y;
for (; false;) {
{
let y;
y = 1;
}
}
var z0;
for (; false;) {
switch (1){
case 1:
let z0;
() => z0;
break;
}
}
var z;
for (; false;) {
switch (1){
case 1:
let z;
z = 1;
break;
}
}

View File

@ -0,0 +1,126 @@
function a0() {
{
let x = 1;
() => x;
}
{
let x = 1;
}
}
function a1() {
{
let x;
}
{
let x = 1;
() => x;
}
}
function a2() {
{
let x = 1;
() => x;
}
{
let x;
() => x;
}
}
function a3() {
{
let x = 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a4() {
{
let x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a5() {
{
let x;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a6() {
switch (1) {
case 1:
let x;
break;
}
switch (1) {
case 1:
let x;
break;
}
}
function a7() {
switch (1) {
case 1:
let x;
() => x;
break;
}
switch (1) {
case 1:
let x;
break;
}
}
function a8() {
switch (1) {
case 1:
let x;
break;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a9() {
switch (1) {
case 1:
let x;
() => x;
break;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}

View File

@ -0,0 +1,68 @@
function a0() {
{
for (let x = 0; x < 1; ) {
() => x;
}
}
{
for (let x;;) {
() => x;
}
}
}
function a1() {
for (let x; x < 1;) {
() => x;
}
for (let x;;) {
() => x;
}
}
function a2() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a3() {
for (let x; x < 1;) {
x = x + 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a4() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a5() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}

View File

@ -0,0 +1,40 @@
function a0() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x; x < 1;) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x; x < 1;) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
() => x;
}
}

View File

@ -0,0 +1,80 @@
function a0() {
for (let x in []) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x in []) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x in []) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x in []) {
x = x + 1;
() => x;
}
for (let x;false;) {
x = x + 2;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a4() {
for (let x in []) {
x = x + 1;
}
for (let x;false;) {
x = x + 2;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a5() {
let y;
for (let x in []) {
x = x + 1;
}
for (let x;false;) {
x = x + 2;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}

View File

@ -0,0 +1,88 @@
function a0() {
for (let x of [1]) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
}
}
function a1() {
for (let x of [1]) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
}
}
function a2() {
for (let x of [1]) {
x = x + 1;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a3() {
for (let x of [1]) {
x = x + 1;
() => x;
}
for (let x;;) {
x = x + 2;
() => x;
}
}
function a4() {
for (let x of [1]) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
break;
}
}
function a5() {
for (let x of [1]) {
x = x + 1;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}
function a6() {
for (let x of [1]) {
x = x + 1;
}
switch (1) {
case 1:
let x;
break;
}
}
function a7() {
for (let x of [1]) {
x = x + 1;
() => x;
}
switch (1) {
case 1:
let x;
() => x;
break;
}
}

View File

@ -0,0 +1,7 @@
for (let x; false;) {
() => x;
}
for (let y; false;) {
y = 1;
}

View File

@ -0,0 +1,9 @@
var x;
for (let x; false; ) {
() => x;
}
var y;
for (let y; false; ) {
y = 1;
}

View File

@ -0,0 +1,11 @@
{
let x;
() => x;
}
switch (1) {
case 1:
let y;
() => y;
break;
}