The host can use this class to track for errors reported during script parsing and compilation. Hosting API counterpart for ErrorSink.
Inheritance: System.Object
Beispiel #1
0
        /// <remarks>
        /// Errors are reported to the specified listener.
        /// Returns <c>null</c> if the parser cannot compile the code due to errors.
        /// </remarks>
        public CompiledCode Compile(ErrorListener errorListener)
        {
            ContractUtils.RequiresNotNull(errorListener, nameof(errorListener));

            return(CompileInternal(null, errorListener));
        }
 public ErrorListenerProxySink(ScriptSource source, ErrorListener listener) {
     _listener = listener;
     _source = source;
 }
Beispiel #3
0
        public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments, out TimeSpan durationToRun)
        {
            var compiledCode      = aScriptSource.Compile(compilerOptions, errorListener);
            var essenceScriptCode = compiledCode.essenceScriptCode();

            if (essenceScriptCode == null)
            {
                durationToRun = TimeSpan.Zero;
                return(null);
            }
            var value = essenceScriptCode.Run(scriptScope.scope(), arguments);

            durationToRun = essenceScriptCode.DurationToRun;
            return(value);
        }
 public ErrorListenerProxySink(ScriptSource source, ErrorListener listener)
 {
     _listener = listener;
     _source   = source;
 }
Beispiel #5
0
        public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments)
        {
            var compiledCode      = aScriptSource.Compile(compilerOptions, errorListener);
            var essenceScriptCode = compiledCode.essenceScriptCode();

            if (essenceScriptCode == null)
            {
                return(null);
            }
            return(essenceScriptCode.Run(scriptScope.scope(), arguments));
        }