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
Run 0.21.0 #876
Run 0.21.0 #876
Conversation
precedingNode.type === "ObjectTypeAnnotation" && | ||
followingNode && | ||
followingNode.type === "ObjectTypeAnnotation" | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting, if I put parenthesis around to group things, it works except for the first one.
function f() {
if (
(precedingNode &&
precedingNode.type === "FunctionTypeParam") &&
(enclosingNode &&
enclosingNode.type === "FunctionTypeAnnotation") &&
(followingNode &&
followingNode.type !== "FunctionTypeParam")
) {
addTrailingComment(precedingNode, comment);
return true;
}
}
outputs
function f() {
if (
precedingNode &&
precedingNode.type === "FunctionTypeParam" &&
(enclosingNode && enclosingNode.type === "FunctionTypeAnnotation") &&
(followingNode && followingNode.type !== "FunctionTypeParam")
) {
addTrailingComment(precedingNode, comment);
return true;
}
}
@@ -25,7 +25,7 @@ FastPath.from = function(obj) { | |||
// lightweight FastPath [..., name, value] stacks. | |||
var copy = Object.create(FastPath.prototype); | |||
var stack = [obj.value]; | |||
for (var pp; pp = obj.parentPath; obj = pp) | |||
for (var pp; (pp = obj.parentPath); obj = pp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -58,7 +58,7 @@ function getSortedChildNodes(node, text, resultArray) { | |||
|
|||
if (!resultArray) { | |||
Object.defineProperty(node, childNodesCacheKey, { | |||
value: resultArray = [], | |||
value: (resultArray = []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original code was doing some "smart" things.
No description provided.