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
Forward deopt node path #11832
Forward deopt node path #11832
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c3065e8:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/25983/ |
@@ -21,6 +21,25 @@ describe("evaluation", function () { | |||
}); | |||
} | |||
|
|||
function addDeoptTest(code, type, expectedType) { |
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.
nit: Can you move these tests to packages/babel-traverse/test/evaluation.js
?
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.
Can you also update packages/babel-traverse/src/path/evaluation.js#L410
? The deopt
option is not documented in the output interface.
Fixed |
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.
Thanks.
Do you need anything from me before merging? |
@johanholmerin We have a two-approval policy on merging PR. ping @babel/core-team. |
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.
If this is just restoring lost info (the path) sounds good, was just wondering how this may break existing usage if at all
Currently, when evaluating array values, object keys, and object properties, if a deopt is found, the location is discarded and the location in the array or the object will be used. I suggest this information is kept. It will make it easier to understand the cause of the deopt.