本文整理汇总了Java中org.mozilla.javascript.debug.Debugger类的典型用法代码示例。如果您正苦于以下问题:Java Debugger类的具体用法?Java Debugger怎么用?Java Debugger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Debugger类属于org.mozilla.javascript.debug包,在下文中一共展示了Debugger类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: detach
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
public void detach( Context cx )
{
if ( !isTerminated( ) )
{
terminate( );
}
Debugger dbg = cx.getDebugger( );
if ( dbg instanceof JsDebugger )
{
cx.setDebugger( null, null );
}
isAttached = false;
if ( jsDebugger != null )
{
jsDebugger.dispose( );
jsDebugger = null;
}
if ( factoryListener != null )
{
cx.getFactory( ).removeListener( factoryListener );
factoryListener = null;
}
}
示例2: check
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
static boolean check( String source, int lineNumber )
{
Context cx = Context.enter( );
Debugger oldDebugger = cx.getDebugger( );
Object oldContext = cx.getDebuggerContextData( );
boolean oldGenerate = cx.isGeneratingDebug( );
int oldLevel = cx.getOptimizationLevel( );
try
{
BreakableSourceChecker checker = new BreakableSourceChecker( );
checker.lineNumber = lineNumber + 2;
cx.setDebugger( checker, null );
cx.setGeneratingDebug( true );
cx.setOptimizationLevel( -1 );
cx.compileString( addHeader( source ), "<check>", 1, null ); //$NON-NLS-1$
return checker.breakable;
}
catch ( Exception e )
{
return false;
}
finally
{
cx.setDebugger( oldDebugger, oldContext );
cx.setGeneratingDebug( oldGenerate );
cx.setOptimizationLevel( oldLevel );
Context.exit( );
}
}
示例3: getDebugger
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
/**
* Return the current debugger.
* @return the debugger, or null if none is attached.
*/
public final Debugger getDebugger()
{
return debugger;
}
示例4: addDebugger
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
public void addDebugger(Debugger debugger) {
rhino.setDebugger(debugger, scope);
}
示例5: getDebugger
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
/**
* Return the current debugger.
* @return the debugger, or null if none is attached.
*/
public final Debugger getDebugger()
{
return debugger;
}
示例6: evaluate
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
public synchronized VMValue evaluate( String expression )
{
int currentState = debugger.currentState( );
if ( currentState == VM_TERMINATED )
{
return null;
}
JsValue result = null;
Debugger oldDebugger = cx.getDebugger( );
Object oldContextData = cx.getDebuggerContextData( );
int oldLevel = cx.getOptimizationLevel( );
cx.setDebugger( null, null );
cx.setOptimizationLevel( -1 );
cx.setGeneratingDebug( false );
try
{
Callable script = (Callable) cx.compileString( expression,
EVALUATOR_LITERAL,
0,
null );
Object val = script.call( cx,
scope,
thisObj,
ScriptRuntime.emptyArgs );
if ( val == Undefined.instance )
{
result = new JsValue( UNDEFINED_LITERAL, UNDEFINED_TYPE );
}
else
{
result = new JsValue( val );
}
}
catch ( Exception ex )
{
result = new JsValue( ex.getMessage( ), EXCEPTION_TYPE );
}
finally
{
cx.setGeneratingDebug( true );
cx.setOptimizationLevel( oldLevel );
cx.setDebugger( oldDebugger, oldContextData );
}
return result;
}
示例7: setDebugger
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
/**
* Set the associated debugger.
* @param debugger the debugger to be used on callbacks from
* the engine.
* @param contextData arbitrary object that debugger can use to store
* per Context data.
*/
public final void setDebugger(Debugger debugger, Object contextData)
{
if (sealed) onSealedMutation();
this.debugger = debugger;
debuggerData = contextData;
}
示例8: setDebugger
import org.mozilla.javascript.debug.Debugger; //导入依赖的package包/类
/**
* Set the associated debugger.
* @param debugger the debugger to be used on callbacks from
* the engine.
* @param contextData arbitrary object that debugger can use to store
* per Context data.
*/
public final void setDebugger(Debugger debugger, Object contextData)
{
if (sealed) onSealedMutation();
this.debugger = debugger;
debuggerData = contextData;
}