public TryBlockInfo(int handlerOffset, VariableScope scope, TryBlockInfo outerBlock) { Contract.Requires(handlerOffset > 0); Contract.Requires(scope != null); HandlerOffset = handlerOffset; Scope = scope; OuterBlock = outerBlock; }
internal void LeaveTry() { if (_currentTryBlock == null) { throw new IllegalOpCodeException(OpCode.LeaveTry.ToString()); } _currentTryBlock = _currentTryBlock.OuterBlock; CodeReader.Seek(CodeReader.ReadInteger()); }
internal bool TryHandle(ExceptionObject exception) { Contract.Requires(exception != null); if (_currentTryBlock == null) { return(false); } LocalScope = _currentTryBlock.Scope; CodeReader.Seek(_currentTryBlock.HandlerOffset); _currentTryBlock = _currentTryBlock.OuterBlock; _evalStack.Push(exception.ThrownValue); _evalStack.Push((JSNumberValue)1); return(true); }
internal void EnterTry() { _currentTryBlock = new TryBlockInfo(CodeReader.ReadInteger(), LocalScope, _currentTryBlock); }