TypeScript Version: 3.4.0-dev.20190311
Search Terms: Sourcemap
Code
function test(f: Function): { a: string } {
f();
return { a: "test" };
}
const { a: b } = test(() => {
console.log("foo1");
console.log("foo2");
});
const data = test(() => {
console.log("foo3");
console.log("foo4");
});
tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true,
"sourceMap": true,
"outDir": "out",
},
"include": ["index.ts"]
}
Expected behavior:
Both arrow functions are mapped properly.
Actual behavior:
Only the second arrow function is mapped properly.
Playground Link:
Source-Map-Visualization
TypeScript Version: 3.4.0-dev.20190311
Search Terms: Sourcemap
Code
tsconfig.json
{ "compilerOptions": { /* Basic Options */ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "strict": true, /* Enable all strict type-checking options. */ "esModuleInterop": true, "sourceMap": true, "outDir": "out", }, "include": ["index.ts"] }Expected behavior:
Both arrow functions are mapped properly.
Actual behavior:
Only the second arrow function is mapped properly.
Playground Link:
Source-Map-Visualization