コード例 #1
0
        public RecursionDepthOverflowException(JintCallStack currentStack, string currentExpressionReference)
            : base("The recursion is forbidden by script host.")
        {
            CallExpressionReference = currentExpressionReference;

            CallChain = currentStack.ToString();
        }
コード例 #2
0
ファイル: DebugCallStack.cs プロジェクト: KurtGokhan/jint
        internal DebugCallStack(Engine engine, Location location, JintCallStack callStack, JsValue returnValue)
        {
            _stack = new List <CallFrame>(callStack.Count + 1);
            var executionContext = engine.ExecutionContext;

            foreach (var element in callStack.Stack)
            {
                _stack.Add(new CallFrame(element, executionContext, location, returnValue));
                location         = element.Location;
                returnValue      = null;
                executionContext = element.CallingExecutionContext;
            }
            // Add root location
            _stack.Add(new CallFrame(null, executionContext, location, returnValue: null));
        }
コード例 #3
0
ファイル: Engine.cs プロジェクト: Telligent/jint
        public Engine Execute(Program program, JintCallStack callStack)
        {
            JintCallStack oldCallStack = null;

            if (callStack != null)
            {
                oldCallStack = CallStack;
                CallStack    = callStack;
            }

            try
            {
                using (new StrictModeScope(Options._IsStrict || program.Strict))
                {
                    DeclarationBindingInstantiation(DeclarationBindingType.GlobalCode, program.FunctionDeclarations, program.VariableDeclarations, null, null);

                    var result = _statements.ExecuteProgram(program);
                    if (result.Type == Completion.Throw)
                    {
                        throw result.Exception ?? new JavaScriptException(result.GetValueOrDefault())
                              .SetCallstack(this, result.Location);
                    }

                    _completionValue = result.GetValueOrDefault();
                }
            }
            finally
            {
                if (oldCallStack != null)
                {
                    CallStack = oldCallStack;
                }
            }

            return(this);
        }
コード例 #4
0
 public static void ThrowRecursionDepthOverflowException(JintCallStack currentStack, string currentExpressionReference)
 {
     throw new RecursionDepthOverflowException(currentStack, currentExpressionReference);
 }
コード例 #5
0
 public JavaScriptException(JsValue error, JintCallStack callStack)
     : base(GetErrorMessage(error))
 {
     _errorObject = error;
     CallStack    = callStack;
 }