I added debug API to get names of parameters or variables from DebuggableScript.

This commit is contained in:
igor%mir2.org 2004-11-24 10:03:14 +00:00
Родитель 729c65fb29
Коммит 46983f0e49
2 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -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 &lt; {@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.