whatwg / loader

Loader Standard
https://whatwg.github.io/loader/
Creative Commons Zero v1.0 Universal
609 stars 45 forks source link

Question: which objects will be exposed onto the window / global? #125

Closed joeldenning closed 8 years ago

joeldenning commented 8 years ago

I know that System.loader is put onto the window / global, but don't know enough about reading through these specs to know if objects such as Registry, ModuleStatus, Loader will be exposed.

What is it in the spec that indicates which things are exposed onto the global and which ones aren't? At first, I thought it was potentially the difference between intrinsic objects (such as %RegistryPrototype%) and all the other objects (such as Registry), but now am not sure.

caridy commented 8 years ago

Classes

ModuleStatus Class: Reflect.Module.ModuleStatus

Loader Class: Reflect.Loader

Module Class: Reflect.Module

Registry Class: this one will not be exposed.

Instances

default loader instance: System.loader

default loader's registry: System.loader.registry

module status instances: any entry in System.loader.registry's map.

Note: the spec for each constructor describes how to access that constructor in user-land, e.g.:

The Loader constructor is the %Loader% intrinsic object and the initial value of the Loader property of the the Reflect object. When called as a constructor it creates and initializes a new Loader object. When Loader is called as a function rather than as a constructor, it throws an exception.

Specifically, this part: "the initial value of the Loader property of the the Reflect object"

joeldenning commented 8 years ago

@caridy thanks that helps a lot.