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

Export the definition of "module record" #2157

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

jungkees
Copy link
Contributor

@jungkees jungkees commented Dec 9, 2016

This allows other specs to reference the definition through a bikeshed
autolink. Service Workers spec is one such case.

This allows other specs to reference the definition through a bikeshed
autolink. Service Workers spec is one such case.
@domenic
Copy link
Member

domenic commented Dec 9, 2016

Can you say why service worker needs to get access to this? It should be somewhat of an internal implementation detail.

@jungkees
Copy link
Contributor Author

jungkees commented Dec 9, 2016

Service worker checks a new service worker version by comparing the existing service worker's script and the newly fetched script. I found we haven't considered module script case for that and changed related text: w3c/ServiceWorker#1020 (diff). In that change, I tried to access the module record's [[ECMAScriptCode]] for the equality check. Would that be a right way to compare two module scripts btw?

@domenic
Copy link
Member

domenic commented Dec 9, 2016

That's pretty convincing to me! In most cases the script should be treated as an opaque thing that you use in algorithms like fetch and run, but this is a solid use case for inspecting its source text directly. (And I think it's better to simply let you reach inside than it is to protect the abstraction boundary by having HTML define something like "get the source text of a script".)

@domenic domenic merged commit bcd228e into whatwg:master Dec 9, 2016
@jungkees
Copy link
Contributor Author

jungkees commented Dec 9, 2016

Great. Thanks for the confirmation. I think I need your help with w3c/ServiceWorker#1013 too. Please take a look when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants