lib: remove unintended access to deps/ · nodejs/node@4100001 (original) (raw)
`@@ -214,14 +214,6 @@ def ReadMacros(lines):
`
214
214
`);
`
215
215
`"""
`
216
216
``
217
``
`-
DEPRECATED_DEPS = """\
`
218
``
`-
'use strict';
`
219
``
`-
process.emitWarning(
`
220
``
`-
'Requiring Node.js-bundled \'{module}\' module is deprecated. Please ' +
`
221
``
`-
'install the necessary module locally.', 'DeprecationWarning', 'DEP0084');
`
222
``
`-
module.exports = require('internal/deps/{module}');
`
223
``
`-
"""
`
224
``
-
225
217
`def JS2C(source, target):
`
226
218
`modules = []
`
227
219
`consts = {}
`
`@@ -265,15 +257,11 @@ def AddModule(module, source):
`
265
257
`lines = ExpandConstants(lines, consts)
`
266
258
`lines = ExpandMacros(lines, macros)
`
267
259
``
268
``
`-
deprecated_deps = None
`
269
``
-
270
260
`# On Windows, "./foo.bar" in the .gyp file is passed as "foo.bar"
`
271
261
`# so don't assume there is always a slash in the file path.
`
272
262
`if '/' in name or '\' in name:
`
273
263
`split = re.split('/|\\', name)
`
274
264
`if split[0] == 'deps':
`
275
``
`-
if split[1] == 'node-inspect' or split[1] == 'v8':
`
276
``
`-
deprecated_deps = split[1:]
`
277
265
`split = ['internal'] + split
`
278
266
`else:
`
279
267
`split = split[1:]
`
`@@ -293,12 +281,6 @@ def AddModule(module, source):
`
293
281
`else:
`
294
282
`AddModule(name.split('.', 1)[0], lines)
`
295
283
``
296
``
`-
Add deprecated aliases for deps without 'deps/'
`
297
``
`-
if deprecated_deps is not None:
`
298
``
`-
module = '/'.join(deprecated_deps).split('.', 1)[0]
`
299
``
`-
source = DEPRECATED_DEPS.format(module=module)
`
300
``
`-
AddModule(module, source)
`
301
``
-
302
284
`# Emit result
`
303
285
`output = open(str(target[0]), "w")
`
304
286
`output.write(
`