Instructions:
npm install
npx tsc index.ts
node index.js
For the sample input in:
The output:
BEGIN TRANSFORMED ==================
function f() {
return {
x: 1,
y: 2
};
}
;
const _f = f(),
x = _f.x,
y = _f.y;
END TRANSFORMED ==================
1:10: f ==> 1:10
1:24: x ==> 1:47
1:30: y ==> 1:49
?: _f ==> no binding
1:54: f ==> 1:10
1:47: x ==> 1:47
?: _f ==> no binding
1:47: x ==> 1:47
1:49: y ==> 1:49
?: _f ==> no binding
1:49: y ==> 1:49
In sample output above, scope bindings for the variable _f
introduced by the transform doesn't have scope bindings.
Likely areas in source code related to the behavior based on a quick (and possibly incorrect) glance at source: