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