mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Fixes CR comments
This commit is contained in:
@@ -2491,7 +2491,7 @@ namespace ts {
|
||||
const catchVariable = getGeneratedNameForNode(errorRecord);
|
||||
const returnMethod = createTempVariable(/*recordTempVariable*/ undefined);
|
||||
const values = createValuesHelper(context, expression, node.expression);
|
||||
const next = createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, []);
|
||||
const next = createCall(createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []);
|
||||
|
||||
hoistVariableDeclaration(errorRecord);
|
||||
hoistVariableDeclaration(returnMethod);
|
||||
|
||||
@@ -216,7 +216,11 @@ namespace ts {
|
||||
|
||||
function visitCatchClause(node: CatchClause): CatchClause {
|
||||
if (!node.variableDeclaration) {
|
||||
return updateCatchClause(node, createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)), node.block);
|
||||
return updateCatchClause(
|
||||
node,
|
||||
createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)),
|
||||
visitNode(node.block, visitor, isBlock)
|
||||
);
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [emitter.ignoredCatchParameter.esnext.ts]
|
||||
function fn() {
|
||||
try {} catch {}
|
||||
}
|
||||
|
||||
|
||||
//// [emitter.ignoredCatchParameter.esnext.js]
|
||||
function fn() {
|
||||
try { }
|
||||
catch { }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts ===
|
||||
function fn() {
|
||||
>fn : Symbol(fn, Decl(emitter.ignoredCatchParameter.esnext.ts, 0, 0))
|
||||
|
||||
try {} catch {}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts ===
|
||||
function fn() {
|
||||
>fn : () => void
|
||||
|
||||
try {} catch {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// @target: esnext
|
||||
function f() {
|
||||
try { } catch { }
|
||||
try { } catch {
|
||||
try { } catch { }
|
||||
}
|
||||
try { } catch { } finally { }
|
||||
}
|
||||
@@ -2,11 +2,18 @@
|
||||
function fn() {
|
||||
try { } catch { }
|
||||
|
||||
try { } catch {
|
||||
try { } catch {
|
||||
try { } catch { }
|
||||
}
|
||||
try { } catch { }
|
||||
}
|
||||
|
||||
try { } catch (x) { var x: any; }
|
||||
|
||||
try { } finally { }
|
||||
|
||||
try { } catch { } finally { }
|
||||
|
||||
try { } catch(z) { } finally { }
|
||||
try { } catch (z) { } finally { }
|
||||
}
|
||||
Reference in New Issue
Block a user