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

Forward deopt node path #11832

Merged
merged 3 commits into from Aug 20, 2020
Merged

Forward deopt node path #11832

merged 3 commits into from Aug 20, 2020

Conversation

@johanholmerin
Copy link
Contributor

@johanholmerin johanholmerin commented Jul 13, 2020

Q                       A
Fixed Issues?
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

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.

{
  a: { // <- deopt currently points to this object
    b // <- I suggest pointing to this identifier
  }
}

@codesandbox
Copy link

@codesandbox codesandbox bot commented Jul 13, 2020

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:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
@babel-bot
Copy link
Collaborator

@babel-bot babel-bot commented Jul 13, 2020

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) {

This comment has been minimized.

@JLHwung

JLHwung Jul 15, 2020
Contributor

nit: Can you move these tests to packages/babel-traverse/test/evaluation.js?

Copy link
Contributor

@JLHwung JLHwung left a comment

Can you also update packages/babel-traverse/src/path/evaluation.js#L410? The deopt option is not documented in the output interface.

@johanholmerin
Copy link
Contributor Author

@johanholmerin johanholmerin commented Jul 15, 2020

Fixed

Copy link
Contributor

@JLHwung JLHwung left a comment

Thanks.

@johanholmerin
Copy link
Contributor Author

@johanholmerin johanholmerin commented Aug 16, 2020

Do you need anything from me before merging?

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 16, 2020

@johanholmerin We have a two-approval policy on merging PR. ping @babel/core-team.

@hzoo
hzoo approved these changes Aug 16, 2020
Copy link
Member

@hzoo hzoo left a comment

If this is just restoring lost info (the path) sounds good, was just wondering how this may break existing usage if at all

@JLHwung JLHwung merged commit b9407d7 into babel:main Aug 20, 2020
7 of 9 checks passed
7 of 9 checks passed
build build
Details
codecov/project 88.34% (target 90.00%)
Details
test262-pr Workflow: test262-pr
Details
Gitpod Open an online workspace in Gitpod
Details
Travis CI - Pull Request Build Passed
Details
babel/repl REPL preview is available
Details
build-standalone Workflow: build-standalone
Details
ci/codesandbox Building packages succeeded.
Details
e2e Workflow: e2e
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.