Reload shared function source list

devMode 要照顾到 sharedFunctionFiles，所以暂不提供
removeSharedFunction(String functionName) 功能
开发者可直接使用模板注释功能将不需要的 function 直接注释掉
550098
private synchronized void reloadSharedFunctionSourceList() {
		Map<String, Define> newMap = createSharedFunctionMap();
		for (int i = 0, size = sharedFunctionSourceList.size(); i < size; i++) {
			ISource source = sharedFunctionSourceList.get(i);
			String fileName = source instanceof FileSource ? ((FileSource)source).getFileName() : null;
			
			Env env = new Env(this);
			new Parser(env, source.getContent(), fileName).parse();
			addToSharedFunctionMap(newMap, env);
			if (devMode) {
				env.addSource(source);
			}
		}
		this.sharedFunctionMap = newMap;
	}
21176
function unlinkIfLinked() {
  const sharedDeps = getSharedLinked(packageKeys, packageHash);
  if (sharedDeps.length) {
    unlinkPackage(sharedDeps);
  } else {
    log('No shared linked dependencies found');
  }
}
1331737
public void removeArgFromFunction(String varName, DifferentialFunction function) {
        val args = function.args();

        for (int i = 0; i < args.length; i++) {
            if (args[i].getVarName().equals(varName)) {
                /**
                 * Since we are removing the variable reference
                 * from the arguments we need to  update both
                 * the reverse and forward arguments.
                 */
                List<String> reverseArgs = ops.get(function.getOwnName()).getInputsToOp();
                val newArgs = new ArrayList<String>(args.length - 1);
                for (int arg = 0; arg < args.length; arg++) {
                    if (!reverseArgs.get(arg).equals(varName)) {
                        newArgs.add(reverseArgs.get(arg));
                    }
                }

                ops.get(function.getOwnName()).setInputsToOp(newArgs);
                break;
            }
        }
    }
1186128
function() {
			var key, fn, callbacks = {
				'initialize'      : 'onInitialize',
				'change'          : 'onChange',
				'item_add'        : 'onItemAdd',
				'item_remove'     : 'onItemRemove',
				'clear'           : 'onClear',
				'option_add'      : 'onOptionAdd',
				'option_remove'   : 'onOptionRemove',
				'option_clear'    : 'onOptionClear',
				'optgroup_add'    : 'onOptionGroupAdd',
				'optgroup_remove' : 'onOptionGroupRemove',
				'optgroup_clear'  : 'onOptionGroupClear',
				'dropdown_open'   : 'onDropdownOpen',
				'dropdown_close'  : 'onDropdownClose',
				'type'            : 'onType',
				'load'            : 'onLoad',
				'focus'           : 'onFocus',
				'blur'            : 'onBlur'
			};
	
			for (key in callbacks) {
				if (callbacks.hasOwnProperty(key)) {
					fn = this.settings[callbacks[key]];
					if (fn) this.on(key, fn);
				}
			}
		}
1237062
function updateFilesList(adds, removes, prefix, name, currentVersion) {
    let configuration = loadConfiguration();
    let filesList = configuration.filesList;
    let modified = false;

    // manage custom prefix
    if (prefix) {
        configuration.versionPrefix = prefix;
        modified = true;
        print('new custom version prefix: ' + prefix, 'completed', 'spaced22');
    }

    // manage custom name and currentVersion
    if (name) {
        configuration.name = name;
        modified = true;
        print('new project name: ' + name, 'completed', 'spaced22');
    }
    if (currentVersion) {
        configuration.currentVersion = currentVersion;
        modified = true;
        print('new project currentVersion: ' + currentVersion, 'completed', 'spaced22');
    }

    function findFileInList(fileName) {
        for(i = 0; i < configuration.filesList.length; i++) {
            if (configuration.filesList[i].indexOf(fileName) === 0) {
                return i;
            }
        }
        return -1;
    }

    // manage additions
    if (adds) {
        let addArray = adds.split(',');

        addArray.forEach(function(a, index) {
            let fileData = a.split(':');
            let fileName = fileData[0];
            let fileType = fileData[1];

            let fileString;
            let fileTypeString;

            if (fileType) {
                fileString = a;
                fileTypeString = fileType;
            }
            else {
                // autodetect file type
                let ext = fileName.split('.');
                    ext = ext[ext.length - 1];

                for (let key in fileTypeExtensions) {
                    if (fileTypeExtensions.hasOwnProperty(key)) {
                        let extList = fileTypeExtensions[key];

                        if (extList.indexOf(ext) >= 0) {
                            fileType = key;
                            break;
                        }
                    }
                }

                if (fileType) {
                    fileString = fileName + ':' + fileType;
                    fileTypeString = fileType;
                }
                else {
                    fileString = fileName;
                    fileTypeString = 'normal';
                }
            }

            if (fileTypeString !== 'normal' && supportedVersioningTypes.indexOf(fileTypeString) < 0) {
                print('The versioning type: ' + fileTypeString + 'is unknown -> file skipped', 'strongWarning', 'date');
            }
            else {
                if (fs.existsSync(fileName)) {
                    let isInFileList = findFileInList(fileName);

                    if (isInFileList < 0) {
                        if (!modified) {
                            modified = true;
                        }

                        filesList.push(fileString);
                        print('file ' + fileName + ' added to list, type of file: ' + fileTypeString, 'completed', 'date');
                    }
                    else {
                        let oldFileType = configuration.filesList[isInFileList].split(':')[1];

                        if (oldFileType !== fileType) {
                            if (!modified) {
                                modified = true;
                            }

                            filesList[isInFileList] = fileString;
                            print('file ' + fileName + ' is already in list but the type has been changed to: ' + fileTypeString, 'completed', 'date');
                        }
                        else {
                            print('file ' + fileName + ' is already in versionFilesList.json with same type -> discarded', 'msgWarning', 'date');
                        }
                    }
                }
                else {
                    print('file ' + a[0] + ' does not exists -> discarded', 'msgWarning', 'date');
                }
            }
        });
    }

    //manage removals
    if (removes) {
        console.log('');
        let remArray = removes.split(',');

        remArray.forEach(function(r, index) {
            let isInFileList = findFileInList(r);

            if (isInFileList >= 0) {
                if (!modified) {
                    modified = true;
                }

                filesList.splice(isInFileList, 1);
                print('file ' + r + ' removed from list', 'completed', 'date');
            }
            else {
                print('file ' + r + ' is not in list -> nothing to remove', 'msgWarning', 'date');
            }
        });
    }

    if (modified) {
        configuration.filesList = filesList;

        fs.writeFileSync('./.versionFilesList.json', JSON.stringify(configuration, null, 2));
        print('.versionFilesList.json updated', 'completed', 'date');
    }

    process.exit(0);
}
949868
def function_end_action(self, text, loc, fun):
        """"""
        if DEBUG > 0:
            print("FUN_END:",fun)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        #set function's attribute to number of function parameters
        self.symtab.set_attribute(self.shared.function_index, self.shared.function_params)
        #clear local function symbols (but leave function name)
        self.symtab.clear_symbols(self.shared.function_index + 1)
        self.codegen.function_end()
298287
function restoreFunctionNames(ast) {
  const functionNames = [];

  t.traverse(ast, {
    FunctionNameMetadata({ node }) {
      functionNames.push({
        name: node.value,
        index: node.index
      });
    }
  });

  if (functionNames.length === 0) {
    return;
  }

  t.traverse(ast, {
    Func({ node }: NodePath<Func>) {
      // $FlowIgnore
      const nodeName: Identifier = node.name;
      const indexBasedFunctionName = nodeName.value;
      const index = Number(indexBasedFunctionName.replace("func_", ""));
      const functionName = functionNames.find(f => f.index === index);
      if (functionName) {
        const oldValue = nodeName.value;

        nodeName.value = functionName.name;
        nodeName.numeric = oldValue;

        // $FlowIgnore
        delete nodeName.raw;
      }
    }
1107985
def remove(self, name, func):
        '''  '''
        was_empty = self._empty()
        if name in self.hooks and func in self.hooks[name]:
            self.hooks[name].remove(func)
        if self.app and not was_empty and self._empty(): self.app.reset()
1151642
private void removeUnreferencedFunctionArgs(Scope fparamScope) {
    // Notice that removing unreferenced function args breaks
    // Function.prototype.length. In advanced mode, we don't really care
    // about this: we consider "length" the equivalent of reflecting on
    // the function's lexical source.
    //
    // Rather than create a new option for this, we assume that if the user
    // is removing globals, then it's OK to remove unused function args.
    //
    // See http://blickly.github.io/closure-compiler-issues/#253
    if (!removeGlobals) {
      return;
    }

    Node function = fparamScope.getRootNode();
    checkState(function.isFunction());
    if (NodeUtil.isGetOrSetKey(function.getParent())) {
      // The parameters object literal setters can not be removed.
      return;
    }

    Node argList = NodeUtil.getFunctionParameters(function);
    // Strip as many unreferenced args off the end of the function declaration as possible.
    maybeRemoveUnusedTrailingParameters(argList, fparamScope);

    // Mark any remaining unused parameters are unused to OptimizeParameters can try to remove
    // them.
    markUnusedParameters(argList, fparamScope);
  }
1286441
def remove_binding(self, function):
        
        assert callable(function)

        for b in self.key_bindings:
            if b.handler == function:
                self.key_bindings.remove(b)
                self._clear_cache()
                return

        # No key binding found for this function. Raise ValueError.
        raise ValueError('Binding not found: %r' % (function, ))
106655
function destroyLocalVariablesList()
    {
        array_pop( $this->LocalVariablesNamesStack );

        if ( $this->LocalVariablesNamesStack )
            $this->CurrentLocalVariablesNames =& $this->LocalVariablesNamesStack[ count( $this->LocalVariablesNamesStack ) - 1];
        else
            unset( $this->CurrentLocalVariablesNames );
    }
84490
function (evt, args) {
            var smList = this._smList;
            if (smList) {
                // smList can be null if the module is in the process of being disposed
                for (var i = 0, l = smList.length; i < l; i++) {
                    if (smList[i] == evt.src) {
                        ariaUtilsArray.removeAt(smList, i);
                        if (evt.reloadingObject) {
                            evt.reloadingObject.$onOnce({
                                "objectLoaded" : {
                                    scope : this,
                                    fn : this.__onSubModuleReloaded
                                }
                            });
                        }
                        break;
                    }
                }
            }
        }
1135094
def cleanup(self):
        

        pending_exits_to_remove = defaultdict(list)

        for func_addr in self._updated_functions:
            if func_addr not in self._jobs:
                continue
            jobs = self._jobs[func_addr]
            for i, pe in enumerate(jobs):
                if pe.returning_source is None:
                    # The original call failed. This pending exit must be followed.
                    continue

                func = self._functions.function(pe.returning_source)
                if func is None:
                    # Why does it happen?
                    l.warning("An expected function at %s is not found. Please report it to Fish.",
                              pe.returning_source if pe.returning_source is not None else 'None')
                    continue

                if func.returning is False:
                    # Oops, it's not returning
                    # Remove this pending exit
                    pending_exits_to_remove[pe.returning_source].append(i)

        for func_addr, indices in pending_exits_to_remove.items():
            jobs = self._jobs[func_addr]
            for index in reversed(indices):
                job = jobs[index]
                self._deregister_job_callback(job.func_addr, job)
                del jobs[index]
                self._job_count -= 1
            if not jobs:
                del self._jobs[func_addr]

        self.clear_updated_functions()
624149
function(filename, fileInfo) {
		var projectName = path.relative(
			app.config.paths.projects,
			path.dirname(filename)
		);

		if (app.projects.get(projectName)) {
			logger.log('Unload project: "' + projectName + '"');
			app.projects.unload({name: projectName});
		}

		// on add or change (info is falsy on unlink)
		if (fileInfo) {
			logger.log('Load project "' + projectName + '" on change');
			app.projects.load({name: projectName}, function(err) {
				if (err) {
					return logger.error(
						'Error during load project "' + projectName + '": ',
						err.stack || err
					);
				}
				logger.log(
					'Project "' + projectName + '" loaded:',
					JSON.stringify(app.projects.get(projectName), null, 4)
				);
			});
		}
	}
23879
private void removeCallBackStruct(Hashtable map, EventCallBackStruct cb_struct) throws DevFailed {
        removeFilters(cb_struct);
        String callback_key = cb_struct.device.name().toLowerCase() +
                "/" + cb_struct.attr_name + "." + cb_struct.event_name;
        map.remove(callback_key);
    }
431265
def remove(self, func):
        """"""
        if not self.data['name'].startswith(self.prefix):
            return
        parent = self.get_parent(self.get_log())
        _, sink_path, _ = self.get_sink()
        client = self.session.client(
            'logging', 'v2', '%s.sinks' % (parent.split('/', 1)[0]))
        try:
            client.execute_command(
                'delete', {'sinkName': sink_path})
        except HttpError as e:
            if e.resp.status != 404:
                raise
852552
public void removeFunction(KnowledgePackageImpl pkg,
                               org.drools.core.rule.Function function) {
        this.functionFactory.removeFunction( function.getName() );

    }