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: nodejs#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 authored and BridgeAR committed May 1, 2018
1 parent 5894cd3 commit b6c47ae
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 errors = require('internal/errors');
var StringDecoder;
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 @@ -50,8 +50,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
@@ -1,11 +1,12 @@
'use strict';

const errors = require('internal/errors');
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 errors = require('internal/errors');
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 @@ -6,7 +6,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 @@ -209,4 +209,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 @@ -107,12 +107,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 @@ -142,10 +142,10 @@
'lib/internal/http2/util.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/BufferList.js',
'lib/internal/streams/buffer_list.js',
'lib/internal/streams/legacy.js',
'lib/internal/streams/destroy.js',
'lib/internal/wrap_js_stream.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');
const errors = require('internal/errors');

common.expectsError(
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,5 +3,5 @@ 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:*:*)
at <anonymous>
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,5 +3,5 @@ file:///*/test/message/esm_display_syntax_error_import.mjs:6
notfound
^^^^^^^^
SyntaxError: The requested module does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/ModuleJob.js:*:*)
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
at <anonymous>
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,5 +3,5 @@ file:///*/test/fixtures/es-module-loaders/syntax-error-import.mjs:1
import { foo, notfound } from './module-named-exports';
^^^^^^^^
SyntaxError: The requested module does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/ModuleJob.js:*:*)
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
at <anonymous>
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,5 +3,5 @@ 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:*:*)
at <anonymous>
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');

// Test empty buffer list.
const emptyList = new BufferList();
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 b6c47ae

Please sign in to comment.