mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-11 16:38:46 -05:00
Test case for "For" statement with object binding pattern
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
//// [sourceMapValidationDestructuringForObjectBindingPattern.ts]
|
||||
declare var console: {
|
||||
log(msg: any): void;
|
||||
}
|
||||
interface Robot {
|
||||
name: string;
|
||||
skill: string;
|
||||
}
|
||||
|
||||
interface MultiRobot {
|
||||
name: string;
|
||||
skills: {
|
||||
primary: string;
|
||||
secondary: string;
|
||||
};
|
||||
}
|
||||
|
||||
let robot: Robot = { name: "mower", skill: "mowing" };
|
||||
let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
|
||||
function getRobot() {
|
||||
return robot;
|
||||
}
|
||||
function getMultiRobot() {
|
||||
return multiRobot;
|
||||
}
|
||||
|
||||
for (let {name: nameA } = robot, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
|
||||
for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
|
||||
//// [sourceMapValidationDestructuringForObjectBindingPattern.js]
|
||||
var robot = { name: "mower", skill: "mowing" };
|
||||
var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
|
||||
function getRobot() {
|
||||
return robot;
|
||||
}
|
||||
function getMultiRobot() {
|
||||
return multiRobot;
|
||||
}
|
||||
for (var nameA = robot.name, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var nameA = getRobot().name, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [sourceMapValidationDestructuringForObjectBindingPattern.js.map]
|
||||
{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"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"}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,282 @@
|
||||
=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts ===
|
||||
declare var console: {
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
|
||||
log(msg: any): void;
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 1, 8))
|
||||
}
|
||||
interface Robot {
|
||||
>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1))
|
||||
|
||||
name: string;
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
|
||||
skill: string;
|
||||
>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17))
|
||||
}
|
||||
|
||||
interface MultiRobot {
|
||||
>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1))
|
||||
|
||||
name: string;
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22))
|
||||
|
||||
skills: {
|
||||
>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
|
||||
primary: string;
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
|
||||
secondary: string;
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
let robot: Robot = { name: "mower", skill: "mowing" };
|
||||
>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3))
|
||||
>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 20))
|
||||
>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 35))
|
||||
|
||||
let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
|
||||
>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3))
|
||||
>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 30))
|
||||
>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 45))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 55))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 74))
|
||||
|
||||
function getRobot() {
|
||||
>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97))
|
||||
|
||||
return robot;
|
||||
>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3))
|
||||
}
|
||||
function getMultiRobot() {
|
||||
>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1))
|
||||
|
||||
return multiRobot;
|
||||
>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3))
|
||||
}
|
||||
|
||||
for (let {name: nameA } = robot, i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10))
|
||||
>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10))
|
||||
}
|
||||
for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10))
|
||||
>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10))
|
||||
}
|
||||
for (let {name: nameA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10))
|
||||
>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 34))
|
||||
>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 51))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10))
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 39))
|
||||
>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20))
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 39))
|
||||
>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20))
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 39))
|
||||
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 17))
|
||||
>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 34))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 44))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 65))
|
||||
|
||||
i = 0; i < 1; i++) {
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20))
|
||||
}
|
||||
|
||||
for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10))
|
||||
>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17))
|
||||
>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 22))
|
||||
>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10))
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10))
|
||||
>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17))
|
||||
>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 22))
|
||||
>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10))
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10))
|
||||
>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17))
|
||||
>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 22))
|
||||
>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 49))
|
||||
>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 66))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87))
|
||||
|
||||
console.log(nameA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10))
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 10))
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 51))
|
||||
>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32))
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 10))
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 51))
|
||||
>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32))
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22))
|
||||
>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 10))
|
||||
>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24))
|
||||
>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 51))
|
||||
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1))
|
||||
>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 17))
|
||||
>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 34))
|
||||
>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 44))
|
||||
>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 65))
|
||||
|
||||
i = 0; i < 1; i++) {
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90))
|
||||
>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90))
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11))
|
||||
>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22))
|
||||
>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32))
|
||||
}
|
||||
@@ -0,0 +1,374 @@
|
||||
=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts ===
|
||||
declare var console: {
|
||||
>console : { log(msg: any): void; }
|
||||
|
||||
log(msg: any): void;
|
||||
>log : (msg: any) => void
|
||||
>msg : any
|
||||
}
|
||||
interface Robot {
|
||||
>Robot : Robot
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
|
||||
skill: string;
|
||||
>skill : string
|
||||
}
|
||||
|
||||
interface MultiRobot {
|
||||
>MultiRobot : MultiRobot
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
|
||||
skills: {
|
||||
>skills : { primary: string; secondary: string; }
|
||||
|
||||
primary: string;
|
||||
>primary : string
|
||||
|
||||
secondary: string;
|
||||
>secondary : string
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
let robot: Robot = { name: "mower", skill: "mowing" };
|
||||
>robot : Robot
|
||||
>Robot : Robot
|
||||
>{ name: "mower", skill: "mowing" } : { name: string; skill: string; }
|
||||
>name : string
|
||||
>"mower" : string
|
||||
>skill : string
|
||||
>"mowing" : string
|
||||
|
||||
let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
|
||||
>multiRobot : MultiRobot
|
||||
>MultiRobot : MultiRobot
|
||||
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
|
||||
>name : string
|
||||
>"mower" : string
|
||||
>skills : { primary: string; secondary: string; }
|
||||
>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; }
|
||||
>primary : string
|
||||
>"mowing" : string
|
||||
>secondary : string
|
||||
>"none" : string
|
||||
|
||||
function getRobot() {
|
||||
>getRobot : () => Robot
|
||||
|
||||
return robot;
|
||||
>robot : Robot
|
||||
}
|
||||
function getMultiRobot() {
|
||||
>getMultiRobot : () => MultiRobot
|
||||
|
||||
return multiRobot;
|
||||
>multiRobot : MultiRobot
|
||||
}
|
||||
|
||||
for (let {name: nameA } = robot, i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>robot : Robot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>getRobot() : Robot
|
||||
>getRobot : () => Robot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let {name: nameA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
><Robot>{ name: "trimmer", skill: "trimming" } : Robot
|
||||
>Robot : Robot
|
||||
>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; }
|
||||
>name : string
|
||||
>"trimmer" : string
|
||||
>skill : string
|
||||
>"trimming" : string
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
>multiRobot : MultiRobot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
>getMultiRobot() : MultiRobot
|
||||
>getMultiRobot : () => MultiRobot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
><MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot
|
||||
>MultiRobot : MultiRobot
|
||||
>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; }
|
||||
>name : string
|
||||
>"trimmer" : string
|
||||
>skills : { primary: string; secondary: string; }
|
||||
>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; }
|
||||
>primary : string
|
||||
>"trimming" : string
|
||||
>secondary : string
|
||||
>"edging" : string
|
||||
|
||||
i = 0; i < 1; i++) {
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
|
||||
for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skill : any
|
||||
>skillA : string
|
||||
>robot : Robot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skill : any
|
||||
>skillA : string
|
||||
>getRobot() : Robot
|
||||
>getRobot : () => Robot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skill : any
|
||||
>skillA : string
|
||||
><Robot>{ name: "trimmer", skill: "trimming" } : Robot
|
||||
>Robot : Robot
|
||||
>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; }
|
||||
>name : string
|
||||
>"trimmer" : string
|
||||
>skill : string
|
||||
>"trimming" : string
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(nameA);
|
||||
>console.log(nameA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>nameA : string
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
>multiRobot : MultiRobot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
>getMultiRobot() : MultiRobot
|
||||
>getMultiRobot : () => MultiRobot
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
>name : any
|
||||
>nameA : string
|
||||
>skills : any
|
||||
>primary : any
|
||||
>primaryA : string
|
||||
>secondary : any
|
||||
>secondaryA : string
|
||||
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
><MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot
|
||||
>MultiRobot : MultiRobot
|
||||
>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; }
|
||||
>name : string
|
||||
>"trimmer" : string
|
||||
>skills : { primary: string; secondary: string; }
|
||||
>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; }
|
||||
>primary : string
|
||||
>"trimming" : string
|
||||
>secondary : string
|
||||
>"edging" : string
|
||||
|
||||
i = 0; i < 1; i++) {
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 1 : boolean
|
||||
>i : number
|
||||
>1 : number
|
||||
>i++ : number
|
||||
>i : number
|
||||
|
||||
console.log(primaryA);
|
||||
>console.log(primaryA) : void
|
||||
>console.log : (msg: any) => void
|
||||
>console : { log(msg: any): void; }
|
||||
>log : (msg: any) => void
|
||||
>primaryA : string
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
// @sourcemap: true
|
||||
declare var console: {
|
||||
log(msg: any): void;
|
||||
}
|
||||
interface Robot {
|
||||
name: string;
|
||||
skill: string;
|
||||
}
|
||||
|
||||
interface MultiRobot {
|
||||
name: string;
|
||||
skills: {
|
||||
primary: string;
|
||||
secondary: string;
|
||||
};
|
||||
}
|
||||
|
||||
let robot: Robot = { name: "mower", skill: "mowing" };
|
||||
let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } };
|
||||
function getRobot() {
|
||||
return robot;
|
||||
}
|
||||
function getMultiRobot() {
|
||||
return multiRobot;
|
||||
}
|
||||
|
||||
for (let {name: nameA } = robot, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let { skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
|
||||
for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skill: skillA } = <Robot>{ name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) {
|
||||
console.log(nameA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } =
|
||||
<MultiRobot>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } },
|
||||
i = 0; i < 1; i++) {
|
||||
console.log(primaryA);
|
||||
}
|
||||
Reference in New Issue
Block a user