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 called window. Afaik it's not required to be accessible at all except through the top level this 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
Add a ment  | 

2 Answers 2

Reset to default 4

The 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