ServerJS/Modules/Environment: Difference between revisions

Jump to navigation Jump to search
Redacted provision for unspecified module factory function arguments.
(Renamed require.entry to require.main to be a bit more familiar.)
(Redacted provision for unspecified module factory function arguments.)
Line 26: Line 26:


* load: the "loader" object, if present, MUST have a "load" method that returns a module factory function.
* load: the "loader" object, if present, MUST have a "load" method that returns a module factory function.
** a module factory function MUST accept "require", "exports", and "environment" as its first arguments.
** a module factory function MUST accept "require", "exports", and "environment" as its arguments.
** a module factory function MAY accept additional optional arguments.
* fetch: a module loader, if present, must provide a "fetch" method that returns the text of a module for a given normalized, fully-qualified, absolute module identifier.
* fetch: a module loader, if present, must provide a "fetch" method that returns the text of a module for a given normalized, fully-qualified, absolute module identifier.
* evaluate: a module loader, if present, must provide an "evaluate" method that accepts a module text and returns a module factory function
* evaluate: a module loader, if present, must provide an "evaluate" method that accepts a module text and returns a module factory function
171

edits

Navigation menu