Skip to content

Commit

Permalink
lib: rename js source to lower snake_case
Browse files Browse the repository at this point in the history
This commit renames all JavaScript source files in lib to lower
snake_case.

PR-URL: #19556
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
  • Loading branch information
danbev committed Mar 28, 2018
1 parent b5884fb commit f2b1079
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Stream = require('stream');
const { Buffer } = require('buffer');
const util = require('util');
const debug = util.debuglog('stream');
const BufferList = require('internal/streams/BufferList');
const BufferList = require('internal/streams/buffer_list');
const destroyImpl = require('internal/streams/destroy');
const { getHighWaterMark } = require('internal/streams/state');
const {
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ module.exports = Module;

// these are below module.exports for the circular reference
const asyncESM = require('internal/process/esm_loader');
const ModuleJob = require('internal/modules/esm/ModuleJob');
const createDynamicModule = require('internal/modules/esm/CreateDynamicModule');
const ModuleJob = require('internal/modules/esm/module_job');
const createDynamicModule = require(
'internal/modules/esm/create_dynamic_module');
const {
CHAR_UPPERCASE_A,
CHAR_LOWERCASE_A,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ const {
ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK,
ERR_UNKNOWN_MODULE_FORMAT
} = require('internal/errors').codes;
const ModuleMap = require('internal/modules/esm/ModuleMap');
const ModuleJob = require('internal/modules/esm/ModuleJob');
const defaultResolve = require('internal/modules/esm/DefaultResolve');
const createDynamicModule = require('internal/modules/esm/CreateDynamicModule');
const translators = require('internal/modules/esm/Translators');
const ModuleMap = require('internal/modules/esm/module_map');
const ModuleJob = require('internal/modules/esm/module_job');
const defaultResolve = require('internal/modules/esm/default_resolve');
const createDynamicModule = require(
'internal/modules/esm/create_dynamic_module');
const translators = require('internal/modules/esm/translators');

const FunctionBind = Function.call.bind(Function.prototype.bind);

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const ModuleJob = require('internal/modules/esm/ModuleJob');
const ModuleJob = require('internal/modules/esm/module_job');
const { SafeMap } = require('internal/safe_globals');
const debug = require('util').debuglog('esm');
const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const {
} = require('internal/modules/cjs/helpers');
const CJSModule = require('internal/modules/cjs/loader');
const internalURLModule = require('internal/url');
const createDynamicModule = require('internal/modules/esm/CreateDynamicModule');
const createDynamicModule = require(
'internal/modules/esm/create_dynamic_module');
const fs = require('fs');
const { _makeLong } = require('path');
const { SafeMap } = require('internal/safe_globals');
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/process/esm_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
} = internalBinding('module_wrap');

const { getURLFromFilePath } = require('internal/url');
const Loader = require('internal/modules/esm/Loader');
const Loader = require('internal/modules/esm/loader');
const path = require('path');
const { URL } = require('url');

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ module.exports = {
};

if (process.binding('config').experimentalVMModules)
module.exports.Module = require('internal/vm/Module').Module;
module.exports.Module = require('internal/vm/module').Module;
16 changes: 8 additions & 8 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@
'lib/internal/linkedlist.js',
'lib/internal/modules/cjs/helpers.js',
'lib/internal/modules/cjs/loader.js',
'lib/internal/modules/esm/Loader.js',
'lib/internal/modules/esm/CreateDynamicModule.js',
'lib/internal/modules/esm/DefaultResolve.js',
'lib/internal/modules/esm/ModuleJob.js',
'lib/internal/modules/esm/ModuleMap.js',
'lib/internal/modules/esm/Translators.js',
'lib/internal/modules/esm/loader.js',
'lib/internal/modules/esm/create_dynamic_module.js',
'lib/internal/modules/esm/default_resolve.js',
'lib/internal/modules/esm/module_job.js',
'lib/internal/modules/esm/module_map.js',
'lib/internal/modules/esm/translators.js',
'lib/internal/safe_globals.js',
'lib/internal/net.js',
'lib/internal/os.js',
Expand Down Expand Up @@ -143,11 +143,11 @@
'lib/internal/v8.js',
'lib/internal/v8_prof_polyfill.js',
'lib/internal/v8_prof_processor.js',
'lib/internal/vm/Module.js',
'lib/internal/stream_base_commons.js',
'lib/internal/vm/module.js',
'lib/internal/streams/lazy_transform.js',
'lib/internal/streams/async_iterator.js',
'lib/internal/streams/BufferList.js',
'lib/internal/streams/buffer_list.js',
'lib/internal/streams/duplex_base.js',
'lib/internal/streams/duplexpair.js',
'lib/internal/streams/legacy.js',
Expand Down
9 changes: 5 additions & 4 deletions test/es-module/test-esm-loader-modulemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
const common = require('../common');

const { URL } = require('url');
const Loader = require('internal/modules/esm/Loader');
const ModuleMap = require('internal/modules/esm/ModuleMap');
const ModuleJob = require('internal/modules/esm/ModuleJob');
const createDynamicModule = require('internal/modules/esm/CreateDynamicModule');
const Loader = require('internal/modules/esm/loader');
const ModuleMap = require('internal/modules/esm/module_map');
const ModuleJob = require('internal/modules/esm/module_job');
const createDynamicModule = require(
'internal/modules/esm/create_dynamic_module');

const stubModuleUrl = new URL('file://tmp/test');
const stubModule = createDynamicModule(['default'], stubModuleUrl);
Expand Down
2 changes: 1 addition & 1 deletion test/es-module/test-esm-loader-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const common = require('../common');

const { search } = require('internal/modules/esm/DefaultResolve');
const { search } = require('internal/modules/esm/default_resolve');

common.expectsError(
() => search('target', undefined),
Expand Down
2 changes: 1 addition & 1 deletion test/message/esm_display_syntax_error.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ file:///*/test/message/esm_display_syntax_error.mjs:3
await async () => 0;
^^^^^
SyntaxError: Unexpected reserved word
at translators.set (internal/modules/esm/Translators.js:*:*)
at translators.set (internal/modules/esm/translators.js:*:*)
2 changes: 1 addition & 1 deletion test/message/esm_display_syntax_error_import.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ file:///*/test/message/esm_display_syntax_error_import.mjs:6
notfound
^^^^^^^^
SyntaxError: The requested module '../fixtures/es-module-loaders/module-named-exports' does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/ModuleJob.js:*:*)
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
2 changes: 1 addition & 1 deletion test/message/esm_display_syntax_error_import_module.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ file:///*/test/fixtures/es-module-loaders/syntax-error-import.mjs:1
import { foo, notfound } from './module-named-exports';
^^^^^^^^
SyntaxError: The requested module './module-named-exports' does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/ModuleJob.js:*:*)
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
2 changes: 1 addition & 1 deletion test/message/esm_display_syntax_error_module.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ file:///*/test/fixtures/es-module-loaders/syntax-error.mjs:2
await async () => 0;
^^^^^
SyntaxError: Unexpected reserved word
at translators.set (internal/modules/esm/Translators.js:*:*)
at translators.set (internal/modules/esm/translators.js:*:*)
2 changes: 1 addition & 1 deletion test/parallel/test-internal-module-map-asserts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const common = require('../common');
const assert = require('assert');
const ModuleMap = require('internal/modules/esm/ModuleMap');
const ModuleMap = require('internal/modules/esm/module_map');

// ModuleMap.get, ModuleMap.has and ModuleMap.set should only accept string
// values as url argument.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-buffer-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';
require('../common');
const assert = require('assert');
const BufferList = require('internal/streams/BufferList');
const BufferList = require('internal/streams/buffer_list');
const util = require('util');

// Test empty buffer list.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream2-readable-from-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
require('../common');
const assert = require('assert');
const fromList = require('_stream_readable')._fromList;
const BufferList = require('internal/streams/BufferList');
const BufferList = require('internal/streams/buffer_list');

function bufferListFromArray(arr) {
const bl = new BufferList();
Expand Down

0 comments on commit f2b1079

Please sign in to comment.