public void EvalMain(string fileName) { string resolvedPath; if (_fileResolver.ResolvePath(_fileSystem, fileName, out resolvedPath)) { var source = _fileSystem.ReadAllBytes(resolvedPath); _mainContext.EvalMain(source, resolvedPath); } }
public void EvalMain(string fileName) { string resolvedPath; if (_fileResolver.ResolvePath(_fileSystem, fileName, out resolvedPath)) { var source = _fileSystem.ReadAllBytes(resolvedPath); var input_bytes = TextUtils.GetShebangNullTerminatedCommonJSBytes(source); _mainContext.EvalMain(input_bytes, resolvedPath); } }
public object EvalMain(string fileName, Type returnType) { var resolvedPath = ResolveFilePath("", fileName); if (resolvedPath != null) { var source = _fileSystem.ReadAllBytes(resolvedPath); return(_mainContext.EvalMain(source, resolvedPath, returnType)); } else { throw new UnexpectedException(fileName, "can not resolve file path"); } }
public object EvalMain(string fileName, Type returnType) { _mainScriptRun = true; if (!string.IsNullOrEmpty(fileName)) { var resolvedPath = ResolveFilePath("", fileName); if (resolvedPath != null) { var source = _fileSystem.ReadAllBytes(resolvedPath); var fullPath = _fileSystem.GetFullPath(resolvedPath); return(_mainContext.EvalMain(source, resolvedPath, fullPath, returnType)); } else { throw new UnexpectedException(fileName, "can not resolve file path"); } } return(null); }