Java 类org.mozilla.javascript.debug.DebuggableScript 实例源码

项目:birt    文件:JsDebugger.java   
public DebugFrame getFrame( Context arg0, DebuggableScript arg1 )
{
    if ( disposed )
    {
        return null;
    }

    JsFunctionSource src = (JsFunctionSource) scripts.get( arg1 );

    if ( src == null )
    {
        // this is not debuggable
        return null;
    }

    System.out.println( ">>>> Frame Source Name: " + src.getSourceName( ) ); //$NON-NLS-1$
    System.out.println( ">>>> Frame Function Name: " + src.getFunctionName( ) ); //$NON-NLS-1$

    return new JsDebugFrame( arg0, this, arg1, src );
}
项目:birt    文件:JsUtil.java   
private void checkBreakable( DebuggableScript script )
{
    int[] nums = script.getLineNumbers( );

    if ( nums != null && nums.length > 0 )
    {
        for ( int i = 0; i < nums.length; i++ )
        {
            if ( nums[i] == lineNumber )
            {
                breakable = true;
                return;
            }
        }
    }

    for ( int i = 0; i < script.getFunctionCount( ); i++ )
    {
        checkBreakable( script.getFunction( i ) );

        if ( breakable )
        {
            return;
        }
    }
}
项目:spring-web-jsflow    文件:ScriptStorage.java   
private void createStubs(final String prefix, final DebuggableScript fnOrScript) {
    final FunctionStub stub = new FunctionStub(scriptName, prefix);
    newStubsToFunctions.put(stub, fnOrScript);
    newFunctionsToStubs.put(fnOrScript, stub);
    final int l = fnOrScript.getFunctionCount();
    for (int i = 0; i < l; ++i) {
        createStubs(prefix + i + ".", fnOrScript.getFunction(i));
    }
}
项目:HL4A    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:HL4A    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:whackpad    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:whackpad    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:quorrabot    文件:ObservingDebugger.java   
@Override
public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript) {
    if (debugFrame == null) {
        debugFrame = new ObservingDebugFrame(isDisconnected);
    }
    return debugFrame;
}
项目:BlocklyBot    文件:JSParser.java   
public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript)
{
    if(debugFrame == null){
        debugFrame = new ObservingDebugFrame(mStop);
    }
    return debugFrame;
}
项目:pizzascript    文件:SourceFile.java   
public static DebuggableScript[] getAllFunctions(DebuggableScript function) {
    ObjArray functions = new ObjArray();
    collectFunctions(function, functions);
    DebuggableScript[] result = new DebuggableScript[functions.size()];
    functions.toArray(result);
    return result;
}
项目:pizzascript    文件:SourceFile.java   
private static void collectFunctions(DebuggableScript function,
                                     ObjArray array) {
    array.add(function);
    for (int i = 0; i != function.getFunctionCount(); ++i) {
        collectFunctions(function.getFunction(i), array);
    }
}
项目:pizzascript    文件:Debugger.java   
private FunctionSource getFunctionSource(DebuggableScript fnOrScript) {
    int firstLine = -1;
    int[] lineNumbers = fnOrScript.getLineNumbers();
    if (lineNumbers != null && lineNumbers.length > 0) {
        firstLine = lineNumbers[0];
        for (int j = 1; j != lineNumbers.length; ++j) {
            int line = lineNumbers[j];
            if (line < firstLine) {
                firstLine = line;
            }
        }
    }

    SourceFile file = null;
    String sourceName = fnOrScript.getSourceName();
    if (sourceName == null || sourceName.equals(this.file.getFilePath())) {
        file = this.file;
    } else {
        file = getSourceFile(sourceName);
    }

    if (file == null) {
        file = this.file;
    }

    return new FunctionSource(file, firstLine, fnOrScript.getFunctionName());
}
项目:TaleCraft    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:TaleCraft    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:PhantomBot    文件:ObservingDebugger.java   
@Override
public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript)
{
    if (debugFrame == null)
    {
        debugFrame = new ObservingDebugFrame(isDisconnected);
    }
    return debugFrame;
}
项目:code404    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:code404    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:rhino-jscover    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:rhino-jscover    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:LoboEvolution    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:LoboEvolution    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:astor    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:astor    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:Rhino-Prov-Mod    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:Rhino-Prov-Mod    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:android-js    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:android-js    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:birt    文件:JsDebugger.java   
public void handleCompilationDone( Context arg0, DebuggableScript arg1,
        String arg2 )
{
    if ( disposed || !arg1.isTopLevel( ) )
    {
        return;
    }

    // check debuggable scripts
    if ( arg1.getSourceName( ) == null
            || arg1.getSourceName( ).equals( ScriptExpression.defaultID ) )
    {
        // skip default scripts, which is only used internally.

        // System.out.println( ">>>> Skipped Source: " //$NON-NLS-1$
        // + arg1.getSourceName( )
        // + "\r\n" //$NON-NLS-1$
        // + arg2
        // + "\r\n>>>> Skipped." ); //$NON-NLS-1$

        return;
    }

    registerTopLevelScripts( arg1, arg2 );

    System.out.println( ">>>> Compiled Source: " //$NON-NLS-1$
            + arg1.getSourceName( )
            + "\r\n" //$NON-NLS-1$
            + arg2
            + "\r\n>>>> end compilation." ); //$NON-NLS-1$
}
项目:birt    文件:JsDebugger.java   
private void registerTopLevelScripts( DebuggableScript script, String source )
{
    List functions = new ArrayList( );
    collectFunctions( script, functions );

    registerFunctions( source, functions );
}
项目:birt    文件:JsDebugger.java   
private void registerFunctions( String source, List functions )
{
    for ( int i = 0; i < functions.size( ); i++ )
    {
        DebuggableScript function = (DebuggableScript) functions.get( i );

        int firstLineNumber = getMinNumber( function.getLineNumbers( ) );

        if ( firstLineNumber == -1 )
        {
            continue;
        }

        String funcName = function.getFunctionName( );

        if ( funcName == null )
        {
            funcName = ""; //$NON-NLS-1$
        }

        scripts.put( function,
                new JsFunctionSource( function.getSourceName( ),
                        funcName,
                        source,
                        firstLineNumber ) );
    }
}
项目:birt    文件:JsDebugger.java   
private void collectFunctions( DebuggableScript function, List holder )
{
    holder.add( function );

    for ( int i = 0; i < function.getFunctionCount( ); i++ )
    {
        collectFunctions( function.getFunction( i ), holder );
    }
}
项目:birt    文件:JsDebugFrame.java   
public JsDebugFrame( Context cx, JsDebugger debugger,
        DebuggableScript script, JsFunctionSource src )
{
    this.cx = cx;
    this.debugger = debugger;
    this.script = script;
    this.src = src;
}
项目:birt    文件:JsUtil.java   
public void handleCompilationDone( Context arg0, DebuggableScript arg1,
        String arg2 )
{
    if ( !arg1.isTopLevel( ) )
    {
        return;
    }

    breakable = false;

    checkBreakable( arg1 );
}
项目:closure-compiler-old    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:closure-compiler-old    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:closure-compiler-copy    文件:Context.java   
/**
 * Return DebuggableScript instance if any associated with the script.
 * If callable supports DebuggableScript implementation, the method
 * returns it. Otherwise null is returned.
 */
public static DebuggableScript getDebuggableView(Script script)
{
    if (script instanceof NativeFunction) {
        return ((NativeFunction)script).getDebuggableView();
    }
    return null;
}
项目:closure-compiler-copy    文件:Context.java   
private static void notifyDebugger_r(Context cx, DebuggableScript dscript,
                                     String debugSource)
{
    cx.debugger.handleCompilationDone(cx, dscript, debugSource);
    for (int i = 0; i != dscript.getFunctionCount(); ++i) {
        notifyDebugger_r(cx, dscript.getFunction(i), debugSource);
    }
}
项目:HL4A    文件:InterpretedFunction.java   
@Override
public DebuggableScript getDebuggableView()
{
    return idata;
}
项目:HL4A    文件:NativeFunction.java   
public DebuggableScript getDebuggableView()
{
    return null;
}
项目:HL4A    文件:InterpreterData.java   
public DebuggableScript getFunction(int index)
{
    return itsNestedFunctions[index];
}