Fix some rest cases and handling of unused results

This commit is contained in:
Ron Buckton 2020-10-22 18:58:21 -07:00
parent 28c4f32ddf
commit 0b303ff08a
24 changed files with 4596 additions and 4700 deletions

View file

@ -2663,12 +2663,14 @@ namespace ts {
node.transformFlags |=
TransformFlags.ContainsES2015 |
TransformFlags.ContainsES2018 |
TransformFlags.ContainsDestructuringAssignment;
TransformFlags.ContainsDestructuringAssignment |
propagateAssignmentPatternFlags(node.left);
}
else if (isArrayLiteralExpression(node.left)) {
node.transformFlags |=
TransformFlags.ContainsES2015 |
TransformFlags.ContainsDestructuringAssignment;
TransformFlags.ContainsDestructuringAssignment |
propagateAssignmentPatternFlags(node.left);
}
}
else if (operatorKind === SyntaxKind.AsteriskAsteriskToken || operatorKind === SyntaxKind.AsteriskAsteriskEqualsToken) {
@ -2680,6 +2682,27 @@ namespace ts {
return node;
}
function propagateAssignmentPatternFlags(node: AssignmentPattern): TransformFlags {
if (node.transformFlags & TransformFlags.ContainsObjectRestOrSpread) return TransformFlags.ContainsObjectRestOrSpread;
if (node.transformFlags & TransformFlags.ContainsES2018) {
// check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c'
// will not be correctly interpreted by the ES2018 transformer
for (const element of getElementsOfBindingOrAssignmentPattern(node)) {
const target = getTargetOfBindingOrAssignmentElement(element);
if (target && isAssignmentPattern(target)) {
if (target.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
return TransformFlags.ContainsObjectRestOrSpread;
}
if (target.transformFlags & TransformFlags.ContainsES2018) {
const flags = propagateAssignmentPatternFlags(target);
if (flags) return flags;
}
}
}
}
return TransformFlags.None;
}
// @api
function updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperatorToken, right: Expression) {
return node.left !== left

View file

@ -355,12 +355,11 @@ namespace ts {
}
function visitor(node: Node): VisitResult<Node> {
if (shouldVisitNode(node)) {
return visitJavaScript(node);
}
else {
return node;
}
return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node;
}
function visitorWithUnusedExpressionResult(node: Node): VisitResult<Node> {
return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node;
}
function callExpressionVisitor(node: Node): VisitResult<Node> {
@ -370,7 +369,7 @@ namespace ts {
return visitor(node);
}
function visitJavaScript(node: Node): VisitResult<Node> {
function visitorWorker(node: Node, expressionResultIsUnused: boolean): VisitResult<Node> {
switch (node.kind) {
case SyntaxKind.StaticKeyword:
return undefined; // elide static keyword
@ -456,10 +455,13 @@ namespace ts {
return visitNewExpression(<NewExpression>node);
case SyntaxKind.ParenthesizedExpression:
return visitParenthesizedExpression(<ParenthesizedExpression>node, /*needsDestructuringValue*/ true);
return visitParenthesizedExpression(<ParenthesizedExpression>node, expressionResultIsUnused);
case SyntaxKind.BinaryExpression:
return visitBinaryExpression(<BinaryExpression>node, /*needsDestructuringValue*/ true);
return visitBinaryExpression(<BinaryExpression>node, expressionResultIsUnused);
case SyntaxKind.CommaListExpression:
return visitCommaListExpression(<CommaListExpression>node, expressionResultIsUnused);
case SyntaxKind.NoSubstitutionTemplateLiteral:
case SyntaxKind.TemplateHead:
@ -507,6 +509,9 @@ namespace ts {
case SyntaxKind.ReturnStatement:
return visitReturnStatement(<ReturnStatement>node);
case SyntaxKind.VoidExpression:
return visitVoidExpression(node as VoidExpression);
default:
return visitEachChild(node, visitor, context);
}
@ -596,6 +601,10 @@ namespace ts {
return node;
}
function visitVoidExpression(node: VoidExpression): Expression {
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
function visitIdentifier(node: Identifier): Identifier {
if (!convertedLoopState) {
return node;
@ -1975,47 +1984,28 @@ namespace ts {
* @param node An ExpressionStatement node.
*/
function visitExpressionStatement(node: ExpressionStatement): Statement {
// If we are here it is most likely because our expression is a destructuring assignment.
switch (node.expression.kind) {
case SyntaxKind.ParenthesizedExpression:
return factory.updateExpressionStatement(node, visitParenthesizedExpression(<ParenthesizedExpression>node.expression, /*needsDestructuringValue*/ false));
case SyntaxKind.BinaryExpression:
return factory.updateExpressionStatement(node, visitBinaryExpression(<BinaryExpression>node.expression, /*needsDestructuringValue*/ false));
}
return visitEachChild(node, visitor, context);
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
/**
* Visits a ParenthesizedExpression that may contain a destructuring assignment.
*
* @param node A ParenthesizedExpression node.
* @param needsDestructuringValue A value indicating whether we need to hold onto the rhs
* of a destructuring assignment.
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitParenthesizedExpression(node: ParenthesizedExpression, needsDestructuringValue: boolean): ParenthesizedExpression {
// If we are here it is most likely because our expression is a destructuring assignment.
if (!needsDestructuringValue) {
// By default we always emit the RHS at the end of a flattened destructuring
// expression. If we are in a state where we do not need the destructuring value,
// we pass that information along to the children that care about it.
switch (node.expression.kind) {
case SyntaxKind.ParenthesizedExpression:
return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(<ParenthesizedExpression>node.expression, /*needsDestructuringValue*/ false));
case SyntaxKind.BinaryExpression:
return factory.updateParenthesizedExpression(node, visitBinaryExpression(<BinaryExpression>node.expression, /*needsDestructuringValue*/ false));
}
}
return visitEachChild(node, visitor, context);
function visitParenthesizedExpression(node: ParenthesizedExpression, expressionResultIsUnused: boolean): ParenthesizedExpression {
return visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);
}
/**
* Visits a BinaryExpression that contains a destructuring assignment.
*
* @param node A BinaryExpression node.
* @param needsDestructuringValue A value indicating whether we need to hold onto the rhs
* of a destructuring assignment.
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitBinaryExpression(node: BinaryExpression, needsDestructuringValue: boolean): Expression {
function visitBinaryExpression(node: BinaryExpression, expressionResultIsUnused: boolean): Expression {
// If we are here it is because this is a destructuring assignment.
if (isDestructuringAssignment(node)) {
return flattenDestructuringAssignment(
@ -2023,11 +2013,40 @@ namespace ts {
visitor,
context,
FlattenLevel.All,
needsDestructuringValue);
!expressionResultIsUnused);
}
if (node.operatorToken.kind === SyntaxKind.CommaToken) {
return factory.updateBinaryExpression(
node,
visitNode(node.left, visitorWithUnusedExpressionResult, isExpression),
node.operatorToken,
visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, isExpression)
);
}
return visitEachChild(node, visitor, context);
}
/**
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitCommaListExpression(node: CommaListExpression, expressionResultIsUnused: boolean): Expression {
if (expressionResultIsUnused) {
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
let result: Expression[] | undefined;
for (let i = 0; i < node.elements.length; i++) {
const element = node.elements[i];
const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression);
if (result || visited !== element) {
result ||= node.elements.slice(0, i);
result.push(visited);
}
}
const elements = result ? setTextRange(factory.createNodeArray(result), node.elements) : node.elements;
return factory.updateCommaListExpression(node, elements);
}
function isVariableStatementOfTypeScriptClassWrapper(node: VariableStatement) {
return node.declarationList.declarations.length === 1
&& !!node.declarationList.declarations[0].initializer
@ -2288,6 +2307,16 @@ namespace ts {
outermostLabeledStatement);
}
function visitEachChildOfForStatement(node: ForStatement) {
return factory.updateForStatement(
node,
visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
visitNode(node.condition, visitor, isExpression),
visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression),
visitNode(node.statement, visitor, isStatement, factory.liftToBlock)
);
}
function visitForInStatement(node: ForInStatement, outermostLabeledStatement: LabeledStatement | undefined) {
return visitIterationStatementWithFacts(
HierarchyFacts.ForInOrForOfStatementExcludes,
@ -2371,7 +2400,7 @@ namespace ts {
// evaluated on every iteration.
const assignment = factory.createAssignment(initializer, boundValue);
if (isDestructuringAssignment(assignment)) {
statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false)));
statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true)));
}
else {
setTextRangeEnd(assignment, initializer.end);
@ -2714,7 +2743,10 @@ namespace ts {
const result = convert
? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts)
: factory.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel);
: factory.restoreEnclosingLabel(
isForStatement(node) ? visitEachChildOfForStatement(node) : visitEachChild(node, visitor, context),
outermostLabeledStatement,
convertedLoopState && resetLabel);
if (convertedLoopState) {
convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
@ -2777,9 +2809,9 @@ namespace ts {
const shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor);
return factory.updateForStatement(
node,
visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, isForInitializer),
visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
visitNode(shouldConvertCondition ? undefined : node.condition, visitor, isExpression),
visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, isExpression),
visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, isExpression),
convertedLoopBody
);
}

View file

@ -119,11 +119,11 @@ namespace ts {
}
function visitor(node: Node): VisitResult<Node> {
return visitorWorker(node, /*noDestructuringValue*/ false);
return visitorWorker(node, /*expressionResultIsUnused*/ false);
}
function visitorNoDestructuringValue(node: Node): VisitResult<Node> {
return visitorWorker(node, /*noDestructuringValue*/ true);
function visitorWithUnusedExpressionResult(node: Node): VisitResult<Node> {
return visitorWorker(node, /*expressionResultIsUnused*/ true);
}
function visitorNoAsyncModifier(node: Node): VisitResult<Node> {
@ -147,7 +147,11 @@ namespace ts {
return visitEachChild(node, visitor, context);
}
function visitorWorker(node: Node, noDestructuringValue: boolean): VisitResult<Node> {
/**
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitorWorker(node: Node, expressionResultIsUnused: boolean): VisitResult<Node> {
if ((node.transformFlags & TransformFlags.ContainsES2018) === 0) {
return node;
}
@ -163,7 +167,9 @@ namespace ts {
case SyntaxKind.ObjectLiteralExpression:
return visitObjectLiteralExpression(node as ObjectLiteralExpression);
case SyntaxKind.BinaryExpression:
return visitBinaryExpression(node as BinaryExpression, noDestructuringValue);
return visitBinaryExpression(node as BinaryExpression, expressionResultIsUnused);
case SyntaxKind.CommaListExpression:
return visitCommaListExpression(node as CommaListExpression, expressionResultIsUnused);
case SyntaxKind.CatchClause:
return visitCatchClause(node as CatchClause);
case SyntaxKind.VariableStatement:
@ -235,7 +241,7 @@ namespace ts {
case SyntaxKind.ExpressionStatement:
return visitExpressionStatement(node as ExpressionStatement);
case SyntaxKind.ParenthesizedExpression:
return visitParenthesizedExpression(node as ParenthesizedExpression, noDestructuringValue);
return visitParenthesizedExpression(node as ParenthesizedExpression, expressionResultIsUnused);
case SyntaxKind.TaggedTemplateExpression:
return visitTaggedTemplateExpression(node as TaggedTemplateExpression);
case SyntaxKind.PropertyAccessExpression:
@ -411,11 +417,15 @@ namespace ts {
}
function visitExpressionStatement(node: ExpressionStatement): ExpressionStatement {
return visitEachChild(node, visitorNoDestructuringValue, context);
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
function visitParenthesizedExpression(node: ParenthesizedExpression, noDestructuringValue: boolean): ParenthesizedExpression {
return visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context);
/**
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitParenthesizedExpression(node: ParenthesizedExpression, expressionResultIsUnused: boolean): ParenthesizedExpression {
return visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);
}
function visitSourceFile(node: SourceFile): SourceFile {
@ -450,28 +460,51 @@ namespace ts {
* Visits a BinaryExpression that contains a destructuring assignment.
*
* @param node A BinaryExpression node.
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitBinaryExpression(node: BinaryExpression, noDestructuringValue: boolean): Expression {
function visitBinaryExpression(node: BinaryExpression, expressionResultIsUnused: boolean): Expression {
if (isDestructuringAssignment(node) && node.left.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
return flattenDestructuringAssignment(
node,
visitor,
context,
FlattenLevel.ObjectRest,
!noDestructuringValue
!expressionResultIsUnused
);
}
else if (node.operatorToken.kind === SyntaxKind.CommaToken) {
if (node.operatorToken.kind === SyntaxKind.CommaToken) {
return factory.updateBinaryExpression(
node,
visitNode(node.left, visitorNoDestructuringValue, isExpression),
visitNode(node.left, visitorWithUnusedExpressionResult, isExpression),
node.operatorToken,
visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, isExpression)
visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, isExpression)
);
}
return visitEachChild(node, visitor, context);
}
/**
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
* expression of an `ExpressionStatement`).
*/
function visitCommaListExpression(node: CommaListExpression, expressionResultIsUnused: boolean): Expression {
if (expressionResultIsUnused) {
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
let result: Expression[] | undefined;
for (let i = 0; i < node.elements.length; i++) {
const element = node.elements[i];
const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression);
if (result || visited !== element) {
result ||= node.elements.slice(0, i);
result.push(visited);
}
}
const elements = result ? setTextRange(factory.createNodeArray(result), node.elements) : node.elements;
return factory.updateCommaListExpression(node, elements);
}
function visitCatchClause(node: CatchClause) {
if (node.variableDeclaration &&
isBindingPattern(node.variableDeclaration.name) &&
@ -539,15 +572,15 @@ namespace ts {
function visitForStatement(node: ForStatement): VisitResult<Statement> {
return factory.updateForStatement(
node,
visitNode(node.initializer, visitorNoDestructuringValue, isForInitializer),
visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
visitNode(node.condition, visitor, isExpression),
visitNode(node.incrementor, visitor, isExpression),
visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression),
visitNode(node.statement, visitor, isStatement)
);
}
function visitVoidExpression(node: VoidExpression) {
return visitEachChild(node, visitorNoDestructuringValue, context);
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
}
/**

View file

@ -36,4 +36,30 @@ describe("unittests:: evaluation:: destructuring", () => {
assert.deepEqual(result.output, [0, 1, 2]);
});
});
describe("correct evaluation for nested rest assignment in destructured object", () => {
it("ES5", () => {
const result = evaluator.evaluateTypeScript(`
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
({ x: { a, ...b } = d } = c);
export const output = { a, b };
`, { target: ts.ScriptTarget.ES5 });
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
});
it("ES2015", () => {
const result = evaluator.evaluateTypeScript(`
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
({ x: { a, ...b } = d } = c);
export const output = { a, b };
`, { target: ts.ScriptTarget.ES2015 });
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
});
it("ES2018", () => {
const result = evaluator.evaluateTypeScript(`
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
({ x: { a, ...b } = d } = c);
export const output = { a, b };
`, { target: ts.ScriptTarget.ES2018 });
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
});
});
});

View file

@ -0,0 +1,20 @@
//// [destructuringObjectAssignmentPatternWithNestedSpread.ts]
let a: any, b: any, c: any = {x: {a: 1, y: 2}}, d: any;
({x: {a, ...b} = d} = c);
//// [destructuringObjectAssignmentPatternWithNestedSpread.js]
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var _a, _b;
let a, b, c = { x: { a: 1, y: 2 } }, d;
(_a = c.x, _b = _a === void 0 ? d : _a, { a } = _b, b = __rest(_b, ["a"]));

View file

@ -0,0 +1,8 @@
//// [destructuringObjectAssignmentPatternWithNestedSpread.ts]
let a: any, b: any, c: any = {x: {a: 1, y: 2}}, d: any;
({x: {a, ...b} = d} = c);
//// [destructuringObjectAssignmentPatternWithNestedSpread.js]
let a, b, c = { x: { a: 1, y: 2 } }, d;
({ x: { a, ...b } = d } = c);

View file

@ -0,0 +1,20 @@
//// [destructuringObjectAssignmentPatternWithNestedSpread.ts]
let a: any, b: any, c: any = {x: {a: 1, y: 2}}, d: any;
({x: {a, ...b} = d} = c);
//// [destructuringObjectAssignmentPatternWithNestedSpread.js]
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var _a, _b;
var a, b, c = { x: { a: 1, y: 2 } }, d;
(_a = c.x, _b = _a === void 0 ? d : _a, a = _b.a, b = __rest(_b, ["a"]));

View file

@ -22,5 +22,5 @@ function a() {
var _a;
var x;
var y;
(_a = {}, (x = _a.x, _a), y = __rest(_a, ["x"]));
(_a = {}, x = _a.x, y = __rest(_a, ["x"]));
}

View file

@ -34,7 +34,7 @@ var o = { a: 1, b: 'no' };
var a = o.a;
var b;
var notAssignable;
(b = o.b, o, notAssignable = __rest(o, ["b"]));
(b = o.b, notAssignable = __rest(o, ["b"]));
function stillMustBeLast(_a) {
var a = _a.a;
}
@ -43,4 +43,4 @@ function generic(t) {
return rest;
}
var rest;
(a = o.a, o, rest.b + rest.b = __rest(o, ["a"]));
(a = o.a, rest.b + rest.b = __rest(o, ["a"]));

View file

@ -20,6 +20,6 @@ var __rest = (this && this.__rest) || function (s, e) {
};
var _a, _b;
var _c = { x: 1 }, x = _c.x; // Error, rest must be last property
(_a = { x: 1 }, (x = _a.x, _a)); // Error, rest must be last property
(_a = { x: 1 }, x = _a.x); // Error, rest must be last property
var _d = { x: 1 }, x = _d.x, b = __rest(_d, ["a", "x"]); // Error, rest must be last property
(_b = { x: 1 }, (x = _b.x, _b), b = __rest(_b, ["x"])); // Error, rest must be last property
(_b = { x: 1 }, x = _b.x, b = __rest(_b, ["x"])); // Error, rest must be last property

View file

@ -49,6 +49,6 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
var _a, _b, _c, _d;
let obj = {};
(Object.assign({}, obj));
let _e = {}, { prop = Object.assign({}, obj), more = _a = Object.assign({}, obj), obj = __rest(_a, []), _a } = _e, _f = '' + 'other', _g = _e[_f], other = _g === void 0 ? Object.assign({}, obj) : _g, _h = _e.yetAnother, _j = _h === void 0 ? Object.assign({}, obj) : _h, _k = _j.nested, _l = _k === void 0 ? Object.assign({}, obj) : _k, _m = 'nested' + 'prop', _o = _l[_m], nestedProp = _o === void 0 ? Object.assign({}, obj) : _o, nestedRest = __rest(_l, [typeof _m === "symbol" ? _m : _m + ""]), { fn = function () { return __asyncGenerator(this, arguments, function* () { }); } } = _e, props = __rest(_e, ["prop", "more", typeof _f === "symbol" ? _f : _f + "", "yetAnother", "fn"]);
let _e = {}, { prop = Object.assign({}, obj) } = _e, _f = _e.more, more = _f === void 0 ? (_a = Object.assign({}, obj), obj = __rest(_a, []), _a) : _f, _g = '' + 'other', _h = _e[_g], other = _h === void 0 ? Object.assign({}, obj) : _h, _j = _e.yetAnother, _k = _j === void 0 ? Object.assign({}, obj) : _j, _l = _k.nested, _m = _l === void 0 ? Object.assign({}, obj) : _l, _o = 'nested' + 'prop', _p = _m[_o], nestedProp = _p === void 0 ? Object.assign({}, obj) : _p, nestedRest = __rest(_m, [typeof _o === "symbol" ? _o : _o + ""]), { fn = function () { return __asyncGenerator(this, arguments, function* () { }); } } = _e, props = __rest(_e, ["prop", "more", typeof _g === "symbol" ? _g : _g + "", "yetAnother", "fn"]);
(_b = {}, { prop = Object.assign({}, obj) } = _b, _c = '' + 'other', _d = _b[_c], other = _d === void 0 ? Object.assign({}, obj) : _d, props = __rest(_b, ["prop", typeof _c === "symbol" ? _c : _c + ""]));
function test(_a) { var { prop = Object.assign({}, obj) } = _a, props = __rest(_a, ["prop"]); }

View file

@ -99,7 +99,7 @@ for ([...multiRobotAInfo] = <MultiSkilledRobot>["trimmer", ["trimming", "edging"
}
//// [sourceMapValidationDestructuringForArrayBindingPattern2.js]
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
var robotA = [1, "mower", "mowing"];
function getRobot() {
return robotA;
@ -114,76 +114,76 @@ var numberB, nameB;
var numberA2, nameA2, skillA2, nameMA;
var numberA3, robotAInfo, multiRobotAInfo;
var i;
for (nameA = robotA[1], robotA, i = 0; i < 1; i++) {
for (nameA = robotA[1], i = 0; i < 1; i++) {
console.log(nameA);
}
for (_a = getRobot(), nameA = _a[1], _a, i = 0; i < 1; i++) {
for (_a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) {
console.log(nameA);
}
for (_b = [2, "trimmer", "trimming"], nameA = _b[1], _b, i = 0; i < 1; i++) {
for (_b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) {
console.log(nameA);
}
for (_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA, i = 0; i < 1; i++) {
for (_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d, i = 0; i < 1; i++) {
for (_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f, i = 0; i < 1; i++) {
for (_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (numberB = robotA[0], robotA, i = 0; i < 1; i++) {
for (numberB = robotA[0], i = 0; i < 1; i++) {
console.log(numberB);
}
for (_h = getRobot(), numberB = _h[0], _h, i = 0; i < 1; i++) {
for (numberB = getRobot()[0], i = 0; i < 1; i++) {
console.log(numberB);
}
for (_j = [2, "trimmer", "trimming"], numberB = _j[0], _j, i = 0; i < 1; i++) {
for (numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) {
console.log(numberB);
}
for (nameB = multiRobotA[0], multiRobotA, i = 0; i < 1; i++) {
for (nameB = multiRobotA[0], i = 0; i < 1; i++) {
console.log(nameB);
}
for (_k = getMultiRobot(), nameB = _k[0], _k, i = 0; i < 1; i++) {
for (nameB = getMultiRobot()[0], i = 0; i < 1; i++) {
console.log(nameB);
}
for (_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l, i = 0; i < 1; i++) {
for (nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) {
console.log(nameB);
}
for (numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA, i = 0; i < 1; i++) {
for (numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) {
console.log(nameA2);
}
for (_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m, i = 0; i < 1; i++) {
for (_h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) {
console.log(nameA2);
}
for (_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o, i = 0; i < 1; i++) {
for (_j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) {
console.log(nameA2);
}
for (nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA, i = 0; i < 1; i++) {
for (nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) {
console.log(nameMA);
}
for (_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q, i = 0; i < 1; i++) {
for (_l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) {
console.log(nameMA);
}
for (_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s, i = 0; i < 1; i++) {
for (_o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) {
console.log(nameMA);
}
for (numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA, i = 0; i < 1; i++) {
for (numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
for (_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u, i = 0; i < 1; i++) {
for (_q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
for (_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v, i = 0; i < 1; i++) {
for (_r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
for (multiRobotAInfo = multiRobotA.slice(0), multiRobotA, i = 0; i < 1; i++) {
for (multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) {
console.log(multiRobotAInfo);
}
for (_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w, i = 0; i < 1; i++) {
for (multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) {
console.log(multiRobotAInfo);
}
for (_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x, i = 0; i < 1; i++) {
for (multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) {
console.log(multiRobotAInfo);
}
//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map

File diff suppressed because one or more lines are too long

View file

@ -115,7 +115,7 @@ for ([numberA3 = -1, ...robotAInfo] = <Robot>[2, "trimmer", "trimming"], i = 0;
}
//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js]
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
var robotA = [1, "mower", "mowing"];
function getRobot() {
return robotA;
@ -130,67 +130,67 @@ var numberB, nameB;
var numberA2, nameA2, skillA2, nameMA;
var numberA3, robotAInfo, multiRobotAInfo;
var i;
for (_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA, i = 0; i < 1; i++) {
for (_a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b, i = 0; i < 1; i++) {
for (_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d, i = 0; i < 1; i++) {
for (_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA, i = 0; i < 1; i++) {
for (_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k, i = 0; i < 1; i++) {
for (_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q, i = 0; i < 1; i++) {
for (_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) {
console.log(primarySkillA);
}
for (_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA, i = 0; i < 1; i++) {
for (_v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) {
console.log(numberB);
}
for (_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w, i = 0; i < 1; i++) {
for (_w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) {
console.log(numberB);
}
for (_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y, i = 0; i < 1; i++) {
for (_x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) {
console.log(numberB);
}
for (_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA, i = 0; i < 1; i++) {
for (_y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) {
console.log(nameB);
}
for (_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1, i = 0; i < 1; i++) {
for (_z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) {
console.log(nameB);
}
for (_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3, i = 0; i < 1; i++) {
for (_0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) {
console.log(nameB);
}
for (_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA, i = 0; i < 1; i++) {
for (_1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) {
console.log(nameA2);
}
for (_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8, i = 0; i < 1; i++) {
for (_4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) {
console.log(nameA2);
}
for (_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12, i = 0; i < 1; i++) {
for (_8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) {
console.log(nameA2);
}
for (var _33 = multiRobotA[0], nameMA_1 = _33 === void 0 ? "noName" : _33, _34 = multiRobotA[1], _35 = _34 === void 0 ? ["none", "none"] : _34, _36 = _35[0], primarySkillA_1 = _36 === void 0 ? "primary" : _36, _37 = _35[1], secondarySkillA_1 = _37 === void 0 ? "secondary" : _37, i_1 = 0; i_1 < 1; i_1++) {
for (var _29 = multiRobotA[0], nameMA_1 = _29 === void 0 ? "noName" : _29, _30 = multiRobotA[1], _31 = _30 === void 0 ? ["none", "none"] : _30, _32 = _31[0], primarySkillA_1 = _32 === void 0 ? "primary" : _32, _33 = _31[1], secondarySkillA_1 = _33 === void 0 ? "secondary" : _33, i_1 = 0; i_1 < 1; i_1++) {
console.log(nameMA_1);
}
for (_16 = getMultiRobot(), _17 = _16[0], nameMA = _17 === void 0 ? "noName" : _17, _18 = _16[1], _19 = _18 === void 0 ? ["none", "none"] : _18, _20 = _19[0], primarySkillA = _20 === void 0 ? "primary" : _20, _21 = _19[1], secondarySkillA = _21 === void 0 ? "secondary" : _21, _16, i = 0; i < 1; i++) {
for (_12 = getMultiRobot(), _13 = _12[0], nameMA = _13 === void 0 ? "noName" : _13, _14 = _12[1], _15 = _14 === void 0 ? ["none", "none"] : _14, _16 = _15[0], primarySkillA = _16 === void 0 ? "primary" : _16, _17 = _15[1], secondarySkillA = _17 === void 0 ? "secondary" : _17, i = 0; i < 1; i++) {
console.log(nameMA);
}
for (_22 = ["trimmer", ["trimming", "edging"]], _23 = _22[0], nameMA = _23 === void 0 ? "noName" : _23, _24 = _22[1], _25 = _24 === void 0 ? ["none", "none"] : _24, _26 = _25[0], primarySkillA = _26 === void 0 ? "primary" : _26, _27 = _25[1], secondarySkillA = _27 === void 0 ? "secondary" : _27, _22, i = 0; i < 1; i++) {
for (_18 = ["trimmer", ["trimming", "edging"]], _19 = _18[0], nameMA = _19 === void 0 ? "noName" : _19, _20 = _18[1], _21 = _20 === void 0 ? ["none", "none"] : _20, _22 = _21[0], primarySkillA = _22 === void 0 ? "primary" : _22, _23 = _21[1], secondarySkillA = _23 === void 0 ? "secondary" : _23, i = 0; i < 1; i++) {
console.log(nameMA);
}
for (_28 = robotA[0], numberA3 = _28 === void 0 ? -1 : _28, robotAInfo = robotA.slice(1), robotA, i = 0; i < 1; i++) {
for (_24 = robotA[0], numberA3 = _24 === void 0 ? -1 : _24, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
for (_29 = getRobot(), _30 = _29[0], numberA3 = _30 === void 0 ? -1 : _30, robotAInfo = _29.slice(1), _29, i = 0; i < 1; i++) {
for (_25 = getRobot(), _26 = _25[0], numberA3 = _26 === void 0 ? -1 : _26, robotAInfo = _25.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
for (_31 = [2, "trimmer", "trimming"], _32 = _31[0], numberA3 = _32 === void 0 ? -1 : _32, robotAInfo = _31.slice(1), _31, i = 0; i < 1; i++) {
for (_27 = [2, "trimmer", "trimming"], _28 = _27[0], numberA3 = _28 === void 0 ? -1 : _28, robotAInfo = _27.slice(1), i = 0; i < 1; i++) {
console.log(numberA3);
}
//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map

View file

@ -111,7 +111,7 @@ for ({ name, skills: { primary, secondary } } =
}
//// [sourceMapValidationDestructuringForObjectBindingPattern2.js]
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
var robot = { name: "mower", skill: "mowing" };
var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
function getRobot() {
@ -122,79 +122,79 @@ function getMultiRobot() {
}
var nameA, primaryA, secondaryA, i, skillA;
var name, primary, secondary, skill;
for (nameA = robot.name, robot, i = 0; i < 1; i++) {
for (nameA = robot.name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_a = getRobot(), nameA = _a.name, _a, i = 0; i < 1; i++) {
for (nameA = getRobot().name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b, i = 0; i < 1; i++) {
for (nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot, i = 0; i < 1; i++) {
for (_a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d, i = 0; i < 1; i++) {
for (_b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f,
for (_c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (name = robot.name, robot, i = 0; i < 1; i++) {
for (name = robot.name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_h = getRobot(), name = _h.name, _h, i = 0; i < 1; i++) {
for (name = getRobot().name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j, i = 0; i < 1; i++) {
for (name = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot, i = 0; i < 1; i++) {
for (_d = multiRobot.skills, primary = _d.primary, secondary = _d.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l, i = 0; i < 1; i++) {
for (_e = getMultiRobot().skills, primary = _e.primary, secondary = _e.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o,
for (_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primary = _f.primary, secondary = _f.secondary,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (nameA = robot.name, skillA = robot.skill, robot, i = 0; i < 1; i++) {
for (nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q, i = 0; i < 1; i++) {
for (_g = getRobot(), nameA = _g.name, skillA = _g.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r, i = 0; i < 1; i++) {
for (_h = { name: "trimmer", skill: "trimming" }, nameA = _h.name, skillA = _h.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot, i = 0; i < 1; i++) {
for (nameA = multiRobot.name, _j = multiRobot.skills, primaryA = _j.primary, secondaryA = _j.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t, i = 0; i < 1; i++) {
for (_k = getMultiRobot(), nameA = _k.name, _l = _k.skills, primaryA = _l.primary, secondaryA = _l.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v,
for (_m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _m.name, _o = _m.skills, primaryA = _o.primary, secondaryA = _o.secondary,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (name = robot.name, skill = robot.skill, robot, i = 0; i < 1; i++) {
for (name = robot.name, skill = robot.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_x = getRobot(), name = _x.name, skill = _x.skill, _x, i = 0; i < 1; i++) {
for (_p = getRobot(), name = _p.name, skill = _p.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y, i = 0; i < 1; i++) {
for (_q = { name: "trimmer", skill: "trimming" }, name = _q.name, skill = _q.skill, i = 0; i < 1; i++) {
console.log(nameA);
}
for (name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot, i = 0; i < 1; i++) {
for (name = multiRobot.name, _r = multiRobot.skills, primary = _r.primary, secondary = _r.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0, i = 0; i < 1; i++) {
for (_s = getMultiRobot(), name = _s.name, _t = _s.skills, primary = _t.primary, secondary = _t.secondary, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2,
for (_u = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _u.name, _v = _u.skills, primary = _v.primary, secondary = _v.secondary,
i = 0; i < 1; i++) {
console.log(primaryA);
}

View file

@ -175,7 +175,7 @@ for ({
}
//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js]
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55;
var robot = { name: "mower", skill: "mowing" };
var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
function getRobot() {
@ -186,79 +186,79 @@ function getMultiRobot() {
}
var nameA, primaryA, secondaryA, i, skillA;
var name, primary, secondary, skill;
for (_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot, i = 0; i < 1; i++) {
for (_a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b, i = 0; i < 1; i++) {
for (_b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d, i = 0; i < 1; i++) {
for (_c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot, i = 0; i < 1; i++) {
for (_d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k, i = 0; i < 1; i++) {
for (_h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q,
for (_m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_v = robot.name, name = _v === void 0 ? "noName" : _v, robot, i = 0; i < 1; i++) {
for (_r = robot.name, name = _r === void 0 ? "noName" : _r, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w, i = 0; i < 1; i++) {
for (_s = getRobot().name, name = _s === void 0 ? "noName" : _s, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y, i = 0; i < 1; i++) {
for (_t = { name: "trimmer", skill: "trimming" }.name, name = _t === void 0 ? "noName" : _t, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot, i = 0; i < 1; i++) {
for (_u = multiRobot.skills, _v = _u === void 0 ? { primary: "none", secondary: "none" } : _u, _w = _v.primary, primary = _w === void 0 ? "primary" : _w, _x = _v.secondary, secondary = _x === void 0 ? "secondary" : _x, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4, i = 0; i < 1; i++) {
for (_y = getMultiRobot().skills, _z = _y === void 0 ? { primary: "none", secondary: "none" } : _y, _0 = _z.primary, primary = _0 === void 0 ? "primary" : _0, _1 = _z.secondary, secondary = _1 === void 0 ? "secondary" : _1, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9,
for (_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _3 = _2 === void 0 ? { primary: "none", secondary: "none" } : _2, _4 = _3.primary, primary = _4 === void 0 ? "primary" : _4, _5 = _3.secondary, secondary = _5 === void 0 ? "secondary" : _5,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot, i = 0; i < 1; i++) {
for (_6 = robot.name, nameA = _6 === void 0 ? "noName" : _6, _7 = robot.skill, skillA = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16, i = 0; i < 1; i++) {
for (_8 = getRobot(), _9 = _8.name, nameA = _9 === void 0 ? "noName" : _9, _10 = _8.skill, skillA = _10 === void 0 ? "skill" : _10, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19, i = 0; i < 1; i++) {
for (_11 = { name: "trimmer", skill: "trimming" }, _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "skill" : _13, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot, i = 0; i < 1; i++) {
for (_14 = multiRobot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = multiRobot.skills, _16 = _15 === void 0 ? { primary: "none", secondary: "none" } : _15, _17 = _16.primary, primaryA = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondaryA = _18 === void 0 ? "secondary" : _18, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27, i = 0; i < 1; i++) {
for (_19 = getMultiRobot(), _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skills, _22 = _21 === void 0 ? { primary: "none", secondary: "none" } : _21, _23 = _22.primary, primaryA = _23 === void 0 ? "primary" : _23, _24 = _22.secondary, secondaryA = _24 === void 0 ? "secondary" : _24, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33,
for (_25 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _26 = _25.name, nameA = _26 === void 0 ? "noName" : _26, _27 = _25.skills, _28 = _27 === void 0 ? { primary: "none", secondary: "none" } : _27, _29 = _28.primary, primaryA = _29 === void 0 ? "primary" : _29, _30 = _28.secondary, secondaryA = _30 === void 0 ? "secondary" : _30,
i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot, i = 0; i < 1; i++) {
for (_31 = robot.name, name = _31 === void 0 ? "noName" : _31, _32 = robot.skill, skill = _32 === void 0 ? "skill" : _32, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41, i = 0; i < 1; i++) {
for (_33 = getRobot(), _34 = _33.name, name = _34 === void 0 ? "noName" : _34, _35 = _33.skill, skill = _35 === void 0 ? "skill" : _35, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44, i = 0; i < 1; i++) {
for (_36 = { name: "trimmer", skill: "trimming" }, _37 = _36.name, name = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skill = _38 === void 0 ? "skill" : _38, i = 0; i < 1; i++) {
console.log(nameA);
}
for (_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot, i = 0; i < 1; i++) {
for (_39 = multiRobot.name, name = _39 === void 0 ? "noName" : _39, _40 = multiRobot.skills, _41 = _40 === void 0 ? { primary: "none", secondary: "none" } : _40, _42 = _41.primary, primary = _42 === void 0 ? "primary" : _42, _43 = _41.secondary, secondary = _43 === void 0 ? "secondary" : _43, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52, i = 0; i < 1; i++) {
for (_44 = getMultiRobot(), _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skills, _47 = _46 === void 0 ? { primary: "none", secondary: "none" } : _46, _48 = _47.primary, primary = _48 === void 0 ? "primary" : _48, _49 = _47.secondary, secondary = _49 === void 0 ? "secondary" : _49, i = 0; i < 1; i++) {
console.log(primaryA);
}
for (_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58,
for (_50 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _51 = _50.name, name = _51 === void 0 ? "noName" : _51, _52 = _50.skills, _53 = _52 === void 0 ? { primary: "none", secondary: "none" } : _52, _54 = _53.primary, primary = _54 === void 0 ? "primary" : _54, _55 = _53.secondary, secondary = _55 === void 0 ? "secondary" : _55,
i = 0; i < 1; i++) {
console.log(primaryA);
}

View file

@ -0,0 +1,4 @@
// @target: es5, es2015, es2018
// @noTypesAndSymbols: true
let a: any, b: any, c: any = {x: {a: 1, y: 2}}, d: any;
({x: {a, ...b} = d} = c);