Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform for F# Pipeline #9984

Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Wait until optimization before pushing placeholder into scope

  • Loading branch information...
thiagoarrais committed May 16, 2019
commit 29fa38558b2dcfd4da5102b5bc57fd23c8f376ff
@@ -30,6 +30,8 @@ const buildOptimizedSequenceExpression = ({ assign, call, path }) => {

call.callee = evalSequence;

path.scope.push({ id: placeholderNode });

return t.sequenceExpression([assign, call]);
}

@@ -38,6 +40,8 @@ const buildOptimizedSequenceExpression = ({ assign, call, path }) => {
return t.sequenceExpression([pipelineLeft, calledExpression.body]);
}

path.scope.push({ id: placeholderNode });

if (param) {
path.get("right").scope.rename(param.name, placeholderNode.name);

@@ -8,7 +8,6 @@ const fsharpVisitor = {
if (operator !== "|>") return;

const placeholder = scope.generateUidIdentifierBasedOnNode(left);
scope.push({ id: placeholder });

const call =
right.type === "AwaitExpression"
@@ -8,7 +8,6 @@ const minimalVisitor = {
if (operator !== "|>") return;

const placeholder = scope.generateUidIdentifierBasedOnNode(left);
scope.push({ id: placeholder });

const call = t.callExpression(right, [t.cloneNode(placeholder)]);
path.replaceWith(
@@ -1,5 +1,3 @@
var _ref, _a;

var a = 1,
b = 2,
c = 3;
@@ -1,5 +1,3 @@
var _ref, _a;

var a = 1,
b = 2,
c = 3;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.