Exemplo n.º 1
0
 public TryBlockInfo(int handlerOffset, VariableScope scope, TryBlockInfo outerBlock)
 {
     Contract.Requires(handlerOffset > 0);
     Contract.Requires(scope != null);
     HandlerOffset = handlerOffset;
     Scope         = scope;
     OuterBlock    = outerBlock;
 }
Exemplo n.º 2
0
 internal void LeaveTry()
 {
     if (_currentTryBlock == null)
     {
         throw new IllegalOpCodeException(OpCode.LeaveTry.ToString());
     }
     _currentTryBlock = _currentTryBlock.OuterBlock;
     CodeReader.Seek(CodeReader.ReadInteger());
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 internal void EnterTry()
 {
     _currentTryBlock = new TryBlockInfo(CodeReader.ReadInteger(), LocalScope, _currentTryBlock);
 }