зеркало из https://github.com/mozilla/gecko-dev.git
New public API Context.getDebuggableView to extract DebuggableScript implementation.
This commit is contained in:
Родитель
09e98b2a17
Коммит
c12fda22c3
|
@ -2123,6 +2123,19 @@ public class Context
|
|||
debuggerData = contextData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls certain aspects of script semantics.
|
||||
* Should be overwritten to alter default behavior.
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
package org.mozilla.javascript;
|
||||
|
||||
import org.mozilla.javascript.debug.DebuggableScript;
|
||||
|
||||
final class InterpretedFunction extends NativeFunction implements Script
|
||||
{
|
||||
InterpreterData idata;
|
||||
|
@ -153,5 +155,10 @@ final class InterpretedFunction extends NativeFunction implements Script
|
|||
{
|
||||
return Interpreter.getEncodedSource(idata);
|
||||
}
|
||||
|
||||
public DebuggableScript getDebuggableView()
|
||||
{
|
||||
return idata;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
package org.mozilla.javascript;
|
||||
|
||||
import org.mozilla.javascript.debug.DebuggableScript;
|
||||
|
||||
/**
|
||||
* This class implements the Function native object.
|
||||
* See ECMA 15.3.
|
||||
|
@ -137,6 +139,11 @@ public class NativeFunction extends BaseFunction
|
|||
return null;
|
||||
}
|
||||
|
||||
public DebuggableScript getDebuggableView()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The "argsNames" array has the following information:
|
||||
* argNames[0] through argNames[argCount - 1]: the names of the parameters
|
||||
|
|
Загрузка…
Ссылка в новой задаче