admin管理员组文章数量:1416313
A while back I read that the System object is a required part of es6 modules, basically a new Object type with all the required semantics for module loading.
Is this a strict es6 requirement? It doesn't seem to be in the latest spec.
A while back I read that the System object is a required part of es6 modules, basically a new Object type with all the required semantics for module loading.
Is this a strict es6 requirement? It doesn't seem to be in the latest spec.
Share Improve this question asked May 24, 2015 at 4:08 backspacesbackspaces 3,9627 gold badges38 silver badges62 bronze badges 4- Could you please link to the site that you found saying this? Googling it mainly brings up results that seem like it’s an unapproved proposal, I think. – Sebastian Simon Commented May 24, 2015 at 4:15
- 2 @Xufox it was part pf the spec until October 2014. – joews Commented May 24, 2015 at 10:32
-
1
note that your question title is misleading, because
window
is specific to page contexts in browsers. In other contexts (browser addons) or pletely different javascript environments the global objects do not have to accessible through a named variable calledwindow
. Afaik it's not required to be accessible at all except through the top levelthis
or things bound to it. – the8472 Commented May 24, 2015 at 10:33 - This may be of interest and why kangax removed modules from pat table. github./kangax/pat-table/issues/316 – backspaces Commented May 24, 2015 at 16:52
2 Answers
Reset to default 4The global System
object is not part of ES2015.
The module loading API, which includes System
, was removed from the ES2015 spec in Draft 28, October 2014.
Module loading is now tracked by the separate WhatWG loader spec.
There is an implementation of the module loader API as specified in Draft 27 (including System
) at https://github./ModuleLoader/es6-module-loader.
It seems that the API was dropped from ES2015, but will eventually be implemented.
I found this repository on GitHub, which talks a bit about the Module Loader API, but if you look at the issues, the first one is named "Programmatic module loader API Specification?". It includes a conversation on the subject.
The first ment says this:
The module loader API was actually removed from ES2015; it should probably just be removed from this repo.
And this is also an interesting ment from there:
Worse, there's no way for import to even load modules, since it doesn't have a loader to consult.
Eventually there will be a loader spec, but until then ES2015 just specifies the syntax, and the syntax does nothing. (That is, the spec contains points where it's like "consult the host environment to do something useful here.")
The person who made both of the previous ments, links to these notes as a reference:
https://github./tc39/tc39-notes/blob/master/es6/2014-09/sept-25.md#loader-pipeline
Conclusion/Resolution
Loader pipeline goes into a separate spec: living document that deals with integration
本文标签: specificationsIs the windowSystem object a required part of JavaScript ES6Stack Overflow
版权声明:本文标题:specifications - Is the window.System object a required part of JavaScript ES6 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745161654a2645467.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论