From 6a2b204bbca1f5189df46ef5c363cab3b2d73262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herbert=20Voj=C4=8D=C3=ADk?= Date: Thu, 12 Feb 2015 14:50:47 +0100 Subject: [PATCH] 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 Conflicts: lib/module.js --- lib/module.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/module.js b/lib/module.js index 3f42975a63c87a..0d9f0932e55b62 100644 --- a/lib/module.js +++ b/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');