NativeFunction.decompile abd NativeFunction.initScriptFunction are final since script function implementations should not override them.

This commit is contained in:
igor%mir2.org 2003-08-27 11:47:19 +00:00
Родитель 894383d75f
Коммит 18456e5ca1
1 изменённых файлов: 8 добавлений и 7 удалений

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

@ -45,21 +45,21 @@ package org.mozilla.javascript;
*/
public class NativeFunction extends BaseFunction
{
public void initScriptFunction(Context cx, String functionName,
String[] argNames, int argCount)
public final void initScriptFunction(Context cx, String functionName,
String[] argNames, int argCount)
{
if (!(argNames != null
if (!(argNames != null
&& 0 <= argCount && argCount <= argNames.length))
{
throw new IllegalArgumentException();
}
if (!(this.argNames == null)) {
// Initialization can only be done once
throw new IllegalStateException();
}
this.functionName = functionName;
this.argNames = argNames;
this.argCount = (short)argCount;
@ -74,7 +74,7 @@ public class NativeFunction extends BaseFunction
* @param justbody Whether the decompilation should omit the
* function header and trailing brace.
*/
public String decompile(Context cx, int indent, boolean justbody)
public final String decompile(Context cx, int indent, boolean justbody)
{
Object encodedSource = getEncodedSource();
if (encodedSource == null) {
@ -129,6 +129,7 @@ public class NativeFunction extends BaseFunction
*/
protected String[] argNames;
protected short argCount;
protected short version;
}