Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
lib: remove unintended access to deps/
This brings DEP0084 to End-of-Life. It is unlikely that this
has received much public usage in the first place, so removing
should be okay.
  • Loading branch information
addaleax committed Dec 19, 2018
commit 4799653b5fd12e062734298bc3f7f86bd3b13d32
9 changes: 6 additions & 3 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1670,16 +1670,19 @@ the client and is now unsupported. Use the `ciphers` parameter instead.
### DEP0084: requiring bundled internal dependencies
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/XXX
description: This functionality has been removed.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/16392
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life.
Comment thread
addaleax marked this conversation as resolved.
Outdated

Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for
internal usage are mistakenly exposed to user code through `require()`. These
modules are:
internal usage were mistakenly exposed to user code through `require()`. These
modules were:

- `v8/tools/codemap`
- `v8/tools/consarray`
Expand Down
4 changes: 1 addition & 3 deletions lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ NativeModule.isDepsModule = function(id) {
};

NativeModule.requireForDeps = function(id) {
if (!NativeModule.exists(id) ||
// TODO(TimothyGu): remove when DEP0084 reaches end of life.
NativeModule.isDepsModule(id)) {
if (!NativeModule.exists(id)) {
id = `internal/deps/${id}`;
}
return NativeModule.require(id);
Expand Down
56 changes: 0 additions & 56 deletions test/parallel/test-require-deps-deprecation.js

This file was deleted.

18 changes: 0 additions & 18 deletions tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ def ReadMacros(lines):
);
"""

DEPRECATED_DEPS = """\
'use strict';
process.emitWarning(
'Requiring Node.js-bundled \\'{module}\\' module is deprecated. Please ' +
'install the necessary module locally.', 'DeprecationWarning', 'DEP0084');
module.exports = require('internal/deps/{module}');
"""

def JS2C(source, target):
modules = []
consts = {}
Expand Down Expand Up @@ -265,15 +257,11 @@ def AddModule(module, source):
lines = ExpandConstants(lines, consts)
lines = ExpandMacros(lines, macros)

deprecated_deps = None

# On Windows, "./foo.bar" in the .gyp file is passed as "foo.bar"
# so don't assume there is always a slash in the file path.
if '/' in name or '\\' in name:
split = re.split('/|\\\\', name)
if split[0] == 'deps':
if split[1] == 'node-inspect' or split[1] == 'v8':
deprecated_deps = split[1:]
split = ['internal'] + split
else:
split = split[1:]
Expand All @@ -293,12 +281,6 @@ def AddModule(module, source):
else:
AddModule(name.split('.', 1)[0], lines)

# Add deprecated aliases for deps without 'deps/'
if deprecated_deps is not None:
module = '/'.join(deprecated_deps).split('.', 1)[0]
source = DEPRECATED_DEPS.format(module=module)
AddModule(module, source)

# Emit result
output = open(str(target[0]), "w")
output.write(
Expand Down