ServerJS/Modules/SecurableModules: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
No edit summary
mNo edit summary
Line 6: Line 6:
## If there is a dependency cycle, the foreign module may not have finished executing at the time it is required by one of its transitive dependencies; in this case, the object returned by "require" must contain at least the exports that the foreign module has prepared before the call to require that led to the current module's execution.
## If there is a dependency cycle, the foreign module may not have finished executing at the time it is required by one of its transitive dependencies; in this case, the object returned by "require" must contain at least the exports that the foreign module has prepared before the call to require that led to the current module's execution.
## If a requested module does not exist, returns "undefined".
## If a requested module does not exist, returns "undefined".
## If the requested module cannot be returned, "require" throws an error.
## If the requested module cannot be returned, "require" may throw an error.
# A module receives an "exports" object that it may add its exported API to as it executes.
# A module receives an "exports" object that it may add its exported API to as it executes.
# Interoperable modules must use the exports object as the only means of exporting, since an implementation may prevent tampering with any other object shared among modules.
# Interoperable modules must use the exports object as the only means of exporting, since an implementation may prevent tampering with any other object shared among modules.
171

edits

Navigation menu