Browse Source

module: replace NativeModule.require

The NativeModule system passes NativeModule.require transparently and so
is unnecessary to call explicitly.

The only one which should have the prefix is the in line 295, where
actually implements a big fs-based module system and actually requires a
native module. That is left unchanged.

PR-URL: https://github.com/joyent/node/pull/9201
Ref: https://github.com/joyent/node/issues/2009
Reviewed-by: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	lib/module.js
v1.8.0-commit
Herbert Vojčík 10 years ago
committed by cjihrig
parent
commit
6a2b204bbc
  1. 8
      lib/module.js

8
lib/module.js

@ -1,11 +1,12 @@
'use strict';
const NativeModule = require('native_module');
const util = NativeModule.require('util');
const util = require('util');
const runInThisContext = require('vm').runInThisContext;
const runInNewContext = require('vm').runInNewContext;
const assert = require('assert').ok;
const fs = NativeModule.require('fs');
const fs = require('fs');
const path = require('path');
// If obj.hasOwnProperty has been overridden, then calling
@ -41,9 +42,6 @@ Module.globalPaths = [];
Module.wrapper = NativeModule.wrapper;
Module.wrap = NativeModule.wrap;
const path = NativeModule.require('path');
Module._debug = util.debuglog('module');

Loading…
Cancel
Save