example/lib/requirejs/require.js
function updateNormalizedNames(pluginName) {

            var oldFullName, oldModuleMap, moduleMap, fullName, callbacks,
                i, j, k, depArray, existingCallbacks,
                maps = normalizedWaiting[pluginName];

            if (maps) {
                for (i = 0; (oldModuleMap = maps[i]); i++) {
                    oldFullName = oldModuleMap.fullName;
                    moduleMap = makeModuleMap(oldModuleMap.originalName, oldModuleMap.parentMap);
                    fullName = moduleMap.fullName;
                    //Callbacks could be undefined if the same plugin!name was
                    //required twice in a row, so use empty array in that case.
                    callbacks = managerCallbacks[oldFullName] || [];
                    existingCallbacks = managerCallbacks[fullName];

                    if (fullName !== oldFullName) {
                        //Update the specified object, but only if it is already
                        //in there. In sync environments, it may not be yet.
                        if (oldFullName in specified) {
                            delete specified[oldFullName];
                            specified[fullName] = true;
                        }

                        //Update managerCallbacks to use the correct normalized name.
                        //If there are already callbacks for the normalized name,
                        //just add to them.
                        if (existingCallbacks) {
                            managerCallbacks[fullName] = existingCallbacks.concat(callbacks);
                        } else {
                            managerCallbacks[fullName] = callbacks;
                        }
                        delete managerCallbacks[oldFullName];

                        //In each manager callback, update the normalized name in the depArray.
                        for (j = 0; j < callbacks.length; j++) {
                            depArray = callbacks[j].depArray;
                            for (k = 0; k < depArray.length; k++) {
                                if (depArray[k] === oldFullName) {
                                    depArray[k] = fullName;
                                }
                            }
                        }
                    }
                }
            }

            delete normalizedWaiting[pluginName];
        }
function updateNormalizedNames(pluginName) {

            var oldFullName, oldModuleMap, moduleMap, fullName, callbacks,
                i, j, k, depArray, existingCallbacks,
                maps = normalizedWaiting[pluginName];

            if (maps) {
                for (i = 0; (oldModuleMap = maps[i]); i++) {
                    oldFullName = oldModuleMap.fullName;
                    moduleMap = makeModuleMap(oldModuleMap.originalName, oldModuleMap.parentMap);
                    fullName = moduleMap.fullName;
                    //Callbacks could be undefined if the same plugin!name was
                    //required twice in a row, so use empty array in that case.
                    callbacks = managerCallbacks[oldFullName] || [];
                    existingCallbacks = managerCallbacks[fullName];

                    if (fullName !== oldFullName) {
                        //Update the specified object, but only if it is already
                        //in there. In sync environments, it may not be yet.
                        if (oldFullName in specified) {
                            delete specified[oldFullName];
                            specified[fullName] = true;
                        }

                        //Update managerCallbacks to use the correct normalized name.
                        //If there are already callbacks for the normalized name,
                        //just add to them.
                        if (existingCallbacks) {
                            managerCallbacks[fullName] = existingCallbacks.concat(callbacks);
                        } else {
                            managerCallbacks[fullName] = callbacks;
                        }
                        delete managerCallbacks[oldFullName];

                        //In each manager callback, update the normalized name in the depArray.
                        for (j = 0; j < callbacks.length; j++) {
                            depArray = callbacks[j].depArray;
                            for (k = 0; k < depArray.length; k++) {
                                if (depArray[k] === oldFullName) {
                                    depArray[k] = fullName;
                                }
                            }
                        }
                    }
                }
            }

            delete normalizedWaiting[pluginName];
        }
function updateNormalizedNames ( pluginName ) { var oldFullName , oldModuleMap , moduleMap , fullName , callbacks , i , j , k , depArray , existingCallbacks , maps = normalizedWaiting [ pluginName ] ; if ( maps ) { for ( i = 0 ; ( oldModuleMap = maps [ i ] ) ; i ++ ) { oldFullName = oldModuleMap . fullName ; moduleMap = makeModuleMap ( oldModuleMap . originalName , oldModuleMap . parentMap ) ; fullName = moduleMap . fullName ; //Callbacks could be undefined if the same plugin!name was //required twice in a row, so use empty array in that case. callbacks = managerCallbacks [ oldFullName ] || [ ] ; existingCallbacks = managerCallbacks [ fullName ] ; if ( fullName !== oldFullName ) { //Update the specified object, but only if it is already //in there. In sync environments, it may not be yet. if ( oldFullName in specified ) { delete specified [ oldFullName ] ; specified [ fullName ] = true ; } //Update managerCallbacks to use the correct normalized name. //If there are already callbacks for the normalized name, //just add to them. if ( existingCallbacks ) { managerCallbacks [ fullName ] = existingCallbacks . concat ( callbacks ) ; } else { managerCallbacks [ fullName ] = callbacks ; } delete managerCallbacks [ oldFullName ] ; //In each manager callback, update the normalized name in the depArray. for ( j = 0 ; j < callbacks . length ; j ++ ) { depArray = callbacks [ j ] . depArray ; for ( k = 0 ; k < depArray . length ; k ++ ) { if ( depArray [ k ] === oldFullName ) { depArray [ k ] = fullName ; } } } } } } delete normalizedWaiting [ pluginName ] ; }
Used to update the normalized name for plugin-based dependencies
after a plugin loads, since it can have its own normalization structure.
@param {String} pluginName the normalized plugin module name.
Used to update the normalized name for plugin - based dependencies after a plugin loads since it can have its own normalization structure .