The scope argument is removed from Context.decompileScript() since

decompilation does not depends on scope.
For compatibility the old signature is preserved as a deprecated method.
This commit is contained in:
igor%mir2.org 2004-08-14 10:28:15 +00:00
Родитель 406e4ecd31
Коммит b33cc857e0
1 изменённых файлов: 14 добавлений и 3 удалений

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

@ -1343,18 +1343,29 @@ public class Context
}
}
/**
* @deprecated Use {@link #decompileScript(Script script, int indent)}
* instead.
* <p>
* The implementation simply calls <tt>decompileScript(script, indent)</tt>
* ignoring the scope argument.
*/
public final String decompileScript(Script script, Scriptable scope,
int indent)
{
return decompileScript(script, indent);
}
/**
* Decompile the script.
* <p>
* The canonical source of the script is returned.
*
* @param script the script to decompile
* @param scope the scope under which to decompile
* @param indent the number of spaces to indent the result
* @return a string representing the script source
*/
public final String decompileScript(Script script, Scriptable scope,
int indent)
public final String decompileScript(Script script, int indent)
{
NativeFunction scriptImpl = (NativeFunction) script;
return scriptImpl.decompile(indent, 0);