Make intentions clearer in code of require.js

Reviewed By: javache

Differential Revision: D5479898

fbshipit-source-id: de73d5cffed4200b81f1d8335a3962a37702df63
This commit is contained in:
Dmitry Zakharov 2017-07-27 13:41:11 -07:00 committed by Facebook Github Bot
parent 1a75751a3b
commit 43457e6674
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ function define(
function require(moduleId: ModuleID | VerboseModuleNameForDev) {
if (__DEV__ && typeof moduleId === 'string') {
const verboseName = moduleId;
moduleId = verboseNamesToModuleIds[moduleId];
moduleId = verboseNamesToModuleIds[verboseName];
if (moduleId == null) {
throw new Error(`Unknown named module: '${verboseName}'`);
} else {

View File

@ -44,7 +44,7 @@ function define(factory, moduleId, dependencyMap) {
function _require(moduleId) {
if (__DEV__ && typeof moduleId === 'string') {
var _verboseName2 = moduleId;
moduleId = verboseNamesToModuleIds[moduleId];
moduleId = verboseNamesToModuleIds[_verboseName2];
if (moduleId == null) {
throw new Error('Unknown named module: \\\\'' + _verboseName2 + '\\\\'');
} else {
@ -311,7 +311,7 @@ function define(factory, moduleId, dependencyMap) {
function _require(moduleId) {
if (__DEV__ && typeof moduleId === 'string') {
var _verboseName2 = moduleId;
moduleId = verboseNamesToModuleIds[moduleId];
moduleId = verboseNamesToModuleIds[_verboseName2];
if (moduleId == null) {
throw new Error('Unknown named module: \\\\'' + _verboseName2 + '\\\\'');
} else {