根据类名注册类
@param script 脚本类
@param depends 依赖类
552695
protected final void registClass(String className,String ...depends) {
		if(!validate(className, depends))
		{
			return ;
		}
		ClassFile cf = getClassFile(className);
		scriptFilePaths.put(cf.getFilePath(), cf);
		_log.info("registClass:"+cf.getFilePath());
		ClassFile subClass=cf;//子类
		for(int i=0;i<depends.length;i++)
		{
			String parentClassName=depends[i];
			ClassFile parentCf=getClassFile(parentClassName);
			subClass.setParent(parentCf);//设置子类
			if(!scriptFilePaths.containsKey(parentCf.getFilePath()))
			{
				scriptFilePaths.put(parentCf.getFilePath(),parentCf);
				_log.info("registDependClass:"+parentCf.getClassName());
			}
			subClass=parentCf;//更新子类为当前父类
		}
	}
16226
private String getInterfaceScript(String scriptName,
			final GeneratorContext context) throws IOException {
		Container container = getContainer(context);
		CreatorManager ctManager = (CreatorManager) container
				.getBean(CreatorManager.class.getName());
		if (ctManager.getCreator(scriptName, false) != null) {
			InterfaceHandler handler = (InterfaceHandler) ContainerUtil
					.getHandlerForUrlProperty(container, INTERFACE_HANDLER_URL);
			return handler.generateInterfaceScript(context.getServletContext()
					.getContextPath(), context.getConfig().getDwrMapping(),
					scriptName);
		} else
			throw new IllegalArgumentException("The DWR bean named '"
					+ scriptName
					+ "' was not found in any DWR configuration instance.");
	}
629883
public static CompiledScript compile(ScriptEngine engine, String script) throws ScriptException {
		if (engine instanceof Compilable) {
			Compilable compEngine = (Compilable) engine;
			return compEngine.compile(script);
		}
		return null;
	}
871957
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlArtifact == null) {
			this.sarlArtifact = SarlFactory.eINSTANCE.createSarlArtifact();
			script.getXtendTypes().add(this.sarlArtifact);
			this.sarlArtifact.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlArtifact.setName(name);
			}
		}
	}
184046
@Deprecated
  public static void loadScript(String url, String id) {
    GQuery gs = GQuery.$(DOM.createElement("script"));
    GQuery gp = GQuery.$("#" + id).parent();
    if (gp.size() != 1) {
      gp = GQuery.$(GQuery.document.getBody());
    }
    GQuery.$("#" + id).remove();
    gp.append(gs.attr("src", url).attr("type", "text/javascript").attr("id", id));
  }
1248137
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEvent == null) {
			this.sarlEvent = SarlFactory.eINSTANCE.createSarlEvent();
			script.getXtendTypes().add(this.sarlEvent);
			this.sarlEvent.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEvent.setName(name);
			}
		}
	}
552277
@RequestMapping(value = "/api/scripts/{scriptIdentifier}", method = RequestMethod.POST)
    public
    @ResponseBody
    Script updateScript(Model model, @PathVariable String scriptIdentifier,
                        @RequestParam(required = false) String name,
                        @RequestParam(required = false) String script) throws Exception {
        int scriptId = Integer.parseInt(scriptIdentifier);

        if (name != null) {
            ScriptService.getInstance().updateName(scriptId, name);
        }

        if (script != null) {
            ScriptService.getInstance().updateScript(scriptId, script);
        }

        return ScriptService.getInstance().getScript(scriptId);
    }
1097064
function(script) {
			if (gui.Type.isString(script)) {
				var func = gui.Object.lookup(script);
				if (func) {
					script = func;
				} else {
					throw new Error(this + ' could not locate "' + script + '"');
				}
			}
			if (gui.Type.isFunction(script)) {
				this.script.load(script);
			} else {
				throw new TypeError(this + " could not load script");
			}
		}
44023
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlInterface == null) {
			this.container = script;
			this.sarlInterface = SarlFactory.eINSTANCE.createSarlInterface();
			script.getXtendTypes().add(this.sarlInterface);
			this.sarlInterface.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlInterface.setName(name);
			}
		}
	}
1261342
function get(scriptModule, agent, msg, cb) {
    const filename = msg.filename;
    if (!filename) {
        cb('empty filename');
        return;
    }

    fs.readFile(path.join(scriptModule.root, filename), 'utf-8', (err, data) => {
        if (err) {
            logger.error(`fail to read script file:${filename}, ${err.stack}`);
            cb(`fail to read script with name:${filename}`);
        }

        cb(null, data);
    });
}
1143080
public T validateScript(Resource scriptResource, Charset charset) {
        try {
            validateScript(FileUtils.readToString(scriptResource, charset));
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read script resource file", e);
        }

        return self;
    }
1243876
function (out) {
            var tplParam = out.templateParam;
            if (tplParam.$hasScript) {
                out.scriptClasspath = tplParam.$classpath + "Script";
                out.scriptClassName = this._getClassName(out.scriptClasspath);
                out.addDependency(out.scriptClasspath);
            }
        }
8488
function loadScripts(scripts, loadedCallback) {
    var srcs = [], property, count, i, src,
        countDown = function () {
          count -= 1;
          if (!count) {
            loadedCallback();
          }
        };

    for (property in scripts) {
      if (!(property in window)) {
        srcs.push(scripts[property]);
      }
    }

    count = srcs.length;
    if (!count) {
      loadedCallback();
    }

    for (i = 0; i < srcs.length; i += 1) {
      src = srcs[i];
      loadScript(src, countDown);
    }
  }
666492
private String getUniqueScriptName(String name, String ext) {
		if (this.getScriptImpl(name) == null) {
			// Its unique
			return name;
		}
		// Its not unique, add a suitable index...
		String stub = name.substring(0, name.length() - ext.length() - 1);
		int index = 1;
		do {
			index++;
			name = stub + "(" + index + ")." + ext;
		}
		while (this.getScriptImpl(name) != null);
		
		return name;
	}
346010
public void setPreInstallScript( final String script) {
        setPreInstallProgram(readProgram(script));
        if ( script != null) format.getHeader().createEntry( PREINSCRIPT, script);
	}
1057054
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEnumeration == null) {
			this.container = script;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			script.getXtendTypes().add(this.sarlEnumeration);
			this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
625538
@SuppressWarnings("unchecked")
	private StringBuffer getInterfaceScript(String scriptName,ServletContext servletContext) {
		StringBuffer sb = new StringBuffer(ENGINE_INIT);

		// List all containers to find all DWR interfaces
		List<Container> containers = ContainerUtil.getAllPublishedContainers(servletContext);
		boolean found = false;
		for(Iterator<Container> it = containers.iterator();it.hasNext() && !found;) {
			Container container = it.next();
			
			// The creatormanager holds the list of beans
			CreatorManager ctManager = (CreatorManager) container.getBean(CreatorManager.class.getName());
			if( null != ctManager ) {
				// The remoter builds interface scripts. 
				Remoter remoter = (Remoter) container.getBean(Remoter.class.getName());
				String path = getPathReplacementString(container);
				try {
					String script = remoter.generateInterfaceScript(scriptName, path);
					found = true;
					// Must remove the engine init script to avoid unneeded duplication
					script = removeEngineInit(script);
					sb.append(script);
				}
				catch(SecurityException ex){throw new BundlingProcessException(ex); }
			}
		}
		if(!found)
			throw new IllegalArgumentException("The DWR bean named '" + scriptName + "' was not found in any DWR configuration instance."); 
		
		return sb;
	}