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

worker: use fake MessageEvent for port.onmessage #26082

Closed

Commits on Feb 13, 2019

  1. worker: use fake MessageEvent for port.onmessage

    Instead of passing the payload for Workers directly to `.onmessage`,
    perform something more similar to what the browser API provides,
    namely create an event object with a `.data` property.
    
    This does not make `MessagePort` implement the `EventTarget` API, nor
    does it implement the full `MessageEvent` API, but it would make
    such extensions non-breaking changes if we desire them at
    some point in the future.
    
    (This would be a breaking change if Workers were not experimental.
    Currently, this method is also undocumented and only exists with
    the idea of enabling some degree of Web compatibility.)
    addaleax committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    1a0418a View commit details
    Browse the repository at this point in the history