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

Make `m.request` work with `async`/`await` correctly. #2428

Merged
merged 2 commits into from Jun 10, 2019

Conversation

@isiahmeadows
Copy link
Collaborator

commented Jun 10, 2019

Description

A very small, subtle workaround with a lot of code explaining why it's necessary. The test was by far harder to get right than the fix itself, and it required a bit of spec reading and careful coding.

Motivation and Context

Fixes #2426

How Has This Been Tested?

Added a new test, after quite a bit of study on the subject matter. Conveniently, Node also uses V8, so I could easily verify the test there. It shouldn't affect others like Firefox, since they should be "working" already.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation change

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/change-log.md
s/xhr/request/g
`m.xhr` was a relic of the rewrite days prior to the release of v1.0.0,
before it was renamed `m.request` to align with v0.2.x. This just strips
some of that legacy naming.

@project-bot project-bot bot added this to Needs triage in Triage/bugs Jun 10, 2019

Make this work with `async`/`await` correctly.
It looked like a V8 bug, but read the two big code comments and follow
their links. It's a bit more subtle than it looks, and V8's in the right
here.

@isiahmeadows isiahmeadows force-pushed the isiahmeadows:fix-request branch from 485a483 to 00481de Jun 10, 2019

@isiahmeadows isiahmeadows marked this pull request as ready for review Jun 10, 2019

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 10, 2019

Posted a long post-mortem/explainer, targeted towards the less technical, on Twitter, in case any of you all are curious.

@isiahmeadows isiahmeadows merged commit 0a1a33a into MithrilJS:next Jun 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Triage/bugs automation moved this from Needs triage to Closed Jun 10, 2019

@isiahmeadows isiahmeadows deleted the isiahmeadows:fix-request branch Jun 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.