internal object IncludeScript(string/*!*/ relativeSourcePath, ScriptInfo/*!*/ script)
{
//if (type == null)
// throw new ArgumentNullException("type");
if (relativeSourcePath == null)
throw new ArgumentNullException("relativeSourcePath");
if (script == null)
throw new ArgumentException("script");
FullPath source_root = Configuration.Application.Compiler.SourceRoot;
PhpSourceFile source_file = new PhpSourceFile(
new FullPath(source_root),
new FullPath(Path.Combine(source_root, relativeSourcePath)));
// the first script becomes the main one:
if (MainScriptFile == null)
DefineMainScript(script, source_file);
return GuardedCall((ScriptInfo scriptInfo) =>
{
//return PhpScript.InvokeMainHelper(
// (Type)scriptType,
return scriptInfo.Main(
this,
null, // no local variables
null, // no object context
null, // no class context
true);
}, script, true);
}