You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recognize the Object.create call from Dougy Crock's top down operator precedence article. I don't think it's needed here though? The problem with this is when I try to clone an AST node with:
constclone={...node};
It doesn't work, because none of the keys on node are enumerable since they're made with Object.create(). So those keys don't show up on the cloned node. It took me a while to debug why an operation wasn't working, and it was because my AST node clone was missing the .data property.
For anyone else who has this unlikely issue, for now I'm converting this node to all enumerable keys (I think) with this function:
I recognize the
Object.create
call from Dougy Crock's top down operator precedence article. I don't think it's needed here though? The problem with this is when I try to clone an AST node with:It doesn't work, because none of the keys on
node
are enumerable since they're made withObject.create()
. So those keys don't show up on the cloned node. It took me a while to debug why an operation wasn't working, and it was because my AST node clone was missing the.data
property.For anyone else who has this unlikely issue, for now I'm converting this node to all enumerable keys (I think) with this function:
The text was updated successfully, but these errors were encountered: