if (workingDir != null)
workingDirName = workingDir.getAbsolutePath();
// Program & VM args
String vmArgs = getVMArguments(configuration);
ExecutionArguments execArgs = new ExecutionArguments(vmArgs, "");
String[] envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration);
// copy jar files which are required to execute JavaScript
JavaScriptLaunchUtil.copyLibraries();
VMRunnerConfiguration runConfig = new VMRunnerConfiguration(
JavaScriptLaunchConstants.JAVASCRIPT_EXECUTOR,
JavaScriptLaunchUtil.getClassPathAsStringArray());
List args = new ArrayList();
String script = configuration.getAttribute(
JavaScriptLaunchConstants.ATTR_JAVASCRIPT_FILE, "");
args.add(fixArgument(script));
List includes = configuration.getAttribute(
JavaScriptLaunchConstants.ATTR_JAVASCRIPT_INCLUDES, Collections.EMPTY_LIST);
IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
for(int i=0;i<includes.size();i++){
String include = (String)includes.get(i);
if(include.startsWith(JavaScriptLibraryTable.PREFIX)){
IResource resource = wsroot.findMember(include.substring(JavaScriptLibraryTable.PREFIX.length()));
if(resource!=null && resource instanceof IFile && resource.exists()){
args.add(fixArgument(((IFile)resource).getLocation().toString()));
}
} else {
args.add(fixArgument(include));
}
}
runConfig.setVMArguments(execArgs.getVMArgumentsArray());
runConfig.setProgramArguments((String[])args.toArray(new String[args.size()]));
runConfig.setWorkingDirectory(workingDirName);
runConfig.setEnvironment(envp);
Map vmAttributesMap = getVMSpecificAttributesMap(configuration);