Skip to content

Commit

Permalink
Don't complain about missing module.resolve until necessary.
Browse files Browse the repository at this point in the history
Calling require("reify/lib/runtime").enable(Module.prototype) before
Module.prototype.resolve has been defined is fine, as long as the resolve
method is defined before module.link calls it. If it's still undefined
then, an exception will be thrown, which fulfills the same purpose as the
exception removed by this commit.
  • Loading branch information
benjamn committed Aug 1, 2018
1 parent 58fa9a0 commit 0b9e50b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/runtime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ var Entry = require("./entry.js");
// specific module objects, or for Module.prototype (where implemented),
// to make the runtime available throughout the entire module system.
exports.enable = function (mod) {
if (typeof mod.resolve !== "function") {
throw new Error("module.resolve not implemented");
}

if (mod.link !== moduleLink) {
mod.link = moduleLink;
mod["export"] = moduleExport;
Expand Down

0 comments on commit 0b9e50b

Please sign in to comment.