зеркало из https://github.com/mozilla/pjs.git
I added debug API to get names of parameters or variables from DebuggableScript.
This commit is contained in:
Родитель
729c65fb29
Коммит
46983f0e49
|
@ -133,6 +133,21 @@ final class InterpreterData implements Serializable, DebuggableScript
|
|||
return itsName;
|
||||
}
|
||||
|
||||
public int getParamCount()
|
||||
{
|
||||
return argCount;
|
||||
}
|
||||
|
||||
public int getParamAndVarCount()
|
||||
{
|
||||
return argNames.length;
|
||||
}
|
||||
|
||||
public String getParamOrVarName(int index)
|
||||
{
|
||||
return argNames[index];
|
||||
}
|
||||
|
||||
public String getSourceName()
|
||||
{
|
||||
return itsSourceFile;
|
||||
|
|
|
@ -60,6 +60,35 @@ public interface DebuggableScript
|
|||
*/
|
||||
public String getFunctionName();
|
||||
|
||||
/**
|
||||
* Get number of declared parameters in function.
|
||||
* Return 0 if this script is not function.
|
||||
*
|
||||
* @see #getParamAndVarCount()
|
||||
* @see #getParamOrVarName(int index)
|
||||
*/
|
||||
public int getParamCount();
|
||||
|
||||
/**
|
||||
* Get number of declared parameters and local variables.
|
||||
* Return number of declared global variables if this script is not
|
||||
* function.
|
||||
*
|
||||
* @see #getParamCount()
|
||||
* @see #getParamOrVarName(int index)
|
||||
*/
|
||||
public int getParamAndVarCount();
|
||||
|
||||
/**
|
||||
* Get name of a declared parameter or local variable.
|
||||
* <tt>index</tt> should be less then {@link #getParamAndVarCount()}.
|
||||
* If <tt>index < {@link #getParamCount()}</tt>, return the name of
|
||||
* the corresponding parameter, otherwise return the name of variable.
|
||||
* If this script is not function, return the name of the declared
|
||||
* global variable.
|
||||
*/
|
||||
public String getParamOrVarName(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the source (usually filename or URL)
|
||||
* of the script.
|
||||
|
|
Загрузка…
Ссылка в новой задаче