Skip to content

Commit

Permalink
module: replace NativeModule.require
Browse files Browse the repository at this point in the history
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: nodejs/node-v0.x-archive#9201
Ref: nodejs/node-v0.x-archive#2009
Reviewed-by: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	lib/module.js
  • Loading branch information
Herbert Vojčík authored and cjihrig committed Feb 13, 2015
1 parent 8c1df7a commit 6a2b204
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/module.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,9 +42,6 @@ Module.globalPaths = [];

Module.wrapper = NativeModule.wrapper;
Module.wrap = NativeModule.wrap;

const path = NativeModule.require('path');

Module._debug = util.debuglog('module');


Expand Down

0 comments on commit 6a2b204

Please sign in to comment.