-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "module: fix inconsistency between load and _findPath"
This reverts commit 1b92214 from PR #22382. See the discussion at nodejs/citgm#604 PR-URL: #23228 Refs: #22382 Fixes: #4778 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
- Loading branch information
Showing
3 changed files
with
20 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
// Refs: https://github.com/nodejs/node/issues/4778 | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const tmpdir = require('../common/tmpdir'); | ||
const file = path.join(tmpdir.path, 'test-extensions.foo.bar'); | ||
|
||
tmpdir.refresh(); | ||
fs.writeFileSync(file, '', 'utf8'); | ||
require.extensions['.foo.bar'] = (module, path) => {}; | ||
delete require.extensions['.foo.bar']; | ||
require.extensions['.bar'] = common.mustCall((module, path) => { | ||
assert.strictEqual(module.id, file); | ||
assert.strictEqual(path, file); | ||
}); | ||
require(path.join(tmpdir.path, 'test-extensions')); |
This file was deleted.
Oops, something went wrong.