Deprecated List (rhino 1.7.14 API)

# Deprecated API

## Contents

- Deprecated Interfaces
- Deprecated Classes
- Deprecated Fields
- Deprecated Methods
- Deprecated Constructors

- Deprecated Interfaces
  Interface and Description
  org.mozilla.javascript.ContextListener Embeddings that wish to customize newly created `Context` instances should implement `ContextFactory.Listener`.

- Deprecated Classes
  Class and Description
  org.mozilla.javascript.tools.shell.ShellLine

- Deprecated Fields
  Field and Description
  org.mozilla.javascript.Context.FEATURE_PARENT_PROTO_PROPRTIES In previous releases, this name was given to FEATURE_PARENT_PROTO_PROPERTIES.

- Deprecated Methods
  Method and Description
  org.mozilla.javascript.ScriptRuntime.add(CharSequence, Object) Use `ScriptRuntime.add(Object, Object, Context)` instead
  org.mozilla.javascript.ScriptRuntime.add(Object, CharSequence) Use `ScriptRuntime.add(Object, Object, Context)` instead
  org.mozilla.javascript.Context.addContextListener(ContextListener)
  org.mozilla.javascript.Context.call(ContextAction<T>) use `ContextFactory.call(ContextAction)` instead as this method relies on usage of a static singleton "global" ContextFactory.
  org.mozilla.javascript.ScriptRuntime.call(Context, Object, Object, Object[], Scriptable) The method is only present for compatibility.
  org.mozilla.javascript.NativeJavaObject.coerceType(Class<?>, Object) as of 1.5 Release 4
  org.mozilla.javascript.Context.compileReader(Scriptable, Reader, String, int, Object)
  org.mozilla.javascript.NativeGlobal.constructError(Context, String, String, Scriptable) Use `ScriptRuntime.constructError(String,String)` instead.
  org.mozilla.javascript.NativeGlobal.constructError(Context, String, String, Scriptable, String, int, int, String) Use `ScriptRuntime.constructError(String,String,String,int,String,int)` instead.
  org.mozilla.javascript.tools.debugger.Main.contextCreated(Context) The method is only present for compatibility and should not be called.
  org.mozilla.javascript.ContextListener.contextEntered(Context) Rhino runtime never calls the method.
  org.mozilla.javascript.tools.debugger.Main.contextEntered(Context) The method is only present for compatibility and should not be called.
  org.mozilla.javascript.ContextListener.contextExited(Context) Rhino runtime never calls the method.
  org.mozilla.javascript.tools.debugger.Main.contextExited(Context) The method is only present for compatibility and should not be called.
  org.mozilla.javascript.tools.debugger.Main.contextReleased(Context) The method is only present for compatibility and should not be called.
  org.mozilla.javascript.FunctionObject.convertArg(Context, Scriptable, Object, Class<?>) Use `FunctionObject.getTypeTag(Class)` and `FunctionObject.convertArg(Context, Scriptable, Object, int)` for type conversion.
  org.mozilla.javascript.ScriptRuntime.createFunctionActivation(NativeFunction, Scriptable, Object[]) Use `ScriptRuntime.createFunctionActivation(NativeFunction, Scriptable, Object[], boolean)` instead
  org.mozilla.javascript.Hashtable.delete(Object) use deleteEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is null
  org.mozilla.javascript.ScriptRuntime.delete(Object, Object, Context) Use `ScriptRuntime.delete(Object, Object, Context, Scriptable, boolean)` instead
  org.mozilla.javascript.ScriptRuntime.delete(Object, Object, Context, boolean) Use `ScriptRuntime.delete(Object, Object, Context, Scriptable, boolean)` instead
  org.mozilla.javascript.ScriptRuntime.doTopCall(Callable, Context, Scriptable, Scriptable, Object[]) Use `ScriptRuntime.doTopCall(Callable, Context, Scriptable, Scriptable, Object[], boolean)` instead
  org.mozilla.javascript.optimizer.OptRuntime.elemIncrDecr(Object, double, Context, int) Use `OptRuntime.elemIncrDecr(Object, double, Context, Scriptable, int)` instead
  org.mozilla.javascript.ScriptRuntime.elemIncrDecr(Object, Object, Context, int) Use `ScriptRuntime.elemIncrDecr(Object, Object, Context, Scriptable, int)` instead
  org.mozilla.javascript.ContextFactory.enter() use `ContextFactory.enterContext()` instead
  org.mozilla.javascript.Context.enter(Context) use `ContextFactory.enterContext(Context)` instead as this method relies on usage of a static singleton "global" ContextFactory.
  org.mozilla.javascript.ScriptRuntime.enumInit(Object, Context, boolean) Use `ScriptRuntime.enumInit(Object, Context, Scriptable, int)` instead
  org.mozilla.javascript.ScriptRuntime.enumInit(Object, Context, int) Use `ScriptRuntime.enumInit(Object, Context, Scriptable, int)` instead
  org.mozilla.javascript.SecurityController.execWithDomain(Context, Scriptable, Script, Object) The application should not override this method and instead override `SecurityController.callWithDomain(Object securityDomain, Context cx, Callable callable, Scriptable scope, Scriptable thisObj, Object[] args)`.
  org.mozilla.javascript.ContextFactory.exit() Use `Context.exit()` instead.
  org.mozilla.javascript.Hashtable.get(Object) use getEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is null
  org.mozilla.javascript.ScriptableObject.getAttributes(int, Scriptable) Use `ScriptableObject.getAttributes(int index)`. The engine always ignored the start argument.
  org.mozilla.javascript.ScriptableObject.getAttributes(String, Scriptable) Use `ScriptableObject.getAttributes(String name)`. The engine always ignored the start argument.
  org.mozilla.javascript.EcmaError.getColumnNumber() Use `RhinoException.columnNumber()` from the super class.
  org.mozilla.javascript.EvaluatorException.getColumnNumber() Use `RhinoException.columnNumber()` from the super class.
  org.mozilla.javascript.ScriptRuntime.getElemFunctionAndThis(Object, Object, Context) Use `ScriptRuntime.getElemFunctionAndThis(Object, Object, Context, Scriptable)` instead
  org.mozilla.javascript.EcmaError.getErrorObject() Always returns null.
  org.mozilla.javascript.ScriptableObject.getGetterOrSetter(String, int, boolean) since 1.7.14. Use the form with the scope to ensure consistent function prototype handling in all cases.
  org.mozilla.javascript.JavaScriptException.getLineNumber() Use `RhinoException.lineNumber()` from the super class.
  org.mozilla.javascript.EcmaError.getLineNumber() Use `RhinoException.lineNumber()` from the super class.
  org.mozilla.javascript.EvaluatorException.getLineNumber() Use `RhinoException.lineNumber()` from the super class.
  org.mozilla.javascript.EcmaError.getLineSource() Use `RhinoException.lineSource()` from the super class.
  org.mozilla.javascript.EvaluatorException.getLineSource() Use `RhinoException.lineSource()` from the super class.
  org.mozilla.javascript.ScriptRuntime.getMessage(String, Object[]) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getMessage0(String) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getMessage1(String, Object) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getMessage2(String, Object, Object) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getMessage3(String, Object, Object, Object) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getMessage4(String, Object, Object, Object, Object) Use `ScriptRuntime.getMessageById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.getObjectElem(Object, Object, Context) Use `ScriptRuntime.getObjectElem(Object, Object, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.getObjectIndex(Object, double, Context) Use `ScriptRuntime.getObjectIndex(Object, double, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.getObjectProp(Object, String, Context) Use `ScriptRuntime.getObjectProp(Object, String, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.getObjectPropNoWarn(Object, String, Context) Use `ScriptRuntime.getObjectPropNoWarn(Object, String, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(Object, String, Context) Use `ScriptRuntime.getPropFunctionAndThis(Object, String, Context, Scriptable)` instead
  org.mozilla.javascript.RhinoException.getScriptStackTrace(FilenameFilter) the filter argument is ignored as we are able to recognize script stack elements by our own. Use #getScriptStackTrace() instead.
  org.mozilla.javascript.JavaScriptException.getSourceName() Use `RhinoException.sourceName()` from the super class.
  org.mozilla.javascript.EcmaError.getSourceName() Use `RhinoException.sourceName()` from the super class.
  org.mozilla.javascript.EvaluatorException.getSourceName() Use `RhinoException.sourceName()` from the super class.
  org.mozilla.javascript.tools.shell.ShellLine.getStream(Scriptable)
  org.mozilla.javascript.ImporterTopLevel.importPackage(Context, Scriptable, Object[], Function) Kept only for compatibility.
  org.mozilla.javascript.ClassCache.isInvokerOptimizationEnabled() The method always returns false.
  org.mozilla.javascript.NativeArray.jsGet_length() Use `NativeArray.getLength()` instead.
  org.mozilla.javascript.NativeFunction.jsGet_name() Use `BaseFunction.getFunctionName()` instead. For backwards compatibility keep an old method name used by Batik and possibly others.
  org.mozilla.javascript.ScriptRuntime.nameIncrDecr(Scriptable, String, int) Use `ScriptRuntime.nameIncrDecr(Scriptable, String, Context, int)` instead
  org.mozilla.javascript.ScriptRuntime.newObjectLiteral(Object[], Object[], Context, Scriptable) Use `ScriptRuntime.newObjectLiteral(Object[], Object[], int[], Context, Scriptable)` instead
  org.mozilla.javascript.Parser.parse(Reader, String, int) use parse(String, String, int) instead
  org.mozilla.javascript.ScriptRuntime.propIncrDecr(Object, String, Context, int) Use `ScriptRuntime.propIncrDecr(Object, String, Context, Scriptable, int)` instead
  org.mozilla.javascript.ScriptRuntime.refIncrDecr(Ref, Context, int) Use `ScriptRuntime.refIncrDecr(Ref, Context, Scriptable, int)` instead
  org.mozilla.javascript.ScriptRuntime.refSet(Ref, Object, Context) Use `ScriptRuntime.refSet(Ref, Object, Context, Scriptable)` instead
  org.mozilla.javascript.Context.removeContextListener(ContextListener)
  org.mozilla.javascript.Ref.set(Context, Object) Use `Ref.set(Context, Scriptable, Object)` instead
  org.mozilla.javascript.ScriptableObject.setAttributes(int, Scriptable, int) Use `ScriptableObject.setAttributes(int index, int attributes)`. The engine always ignored the start argument.
  org.mozilla.javascript.ScriptableObject.setAttributes(String, Scriptable, int) Use `ScriptableObject.setAttributes(String name, int attributes)`. The engine always ignored the start argument.
  org.mozilla.javascript.Context.setCachingEnabled(boolean)
  org.mozilla.javascript.ClassCache.setInvokerOptimizationEnabled(boolean) The method does nothing. Invoker optimization is no longer used by Rhino. On modern JDK like 1.4 or 1.5 the disadvantages of the optimization like increased memory usage or longer initialization time overweight small speed increase that can be gained using generated proxy class to replace reflection.
  org.mozilla.javascript.ScriptRuntime.setObjectElem(Object, Object, Object, Context) Use `ScriptRuntime.setObjectElem(Object, Object, Object, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.setObjectIndex(Object, double, Object, Context) Use `ScriptRuntime.setObjectIndex(Object, double, Object, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.setObjectProp(Object, String, Object, Context) Use `ScriptRuntime.setObjectProp(Object, String, Object, Context, Scriptable)` instead
  org.mozilla.javascript.tools.debugger.Main.setOptimizationLevel(int) The method does nothing and is only present for compatibility.
  org.mozilla.javascript.tools.debugger.Main.setSize(Dimension) Use `Main.setSize(int, int)` instead.
  org.mozilla.javascript.ScriptRuntime.specialRef(Object, String, Context) Use `ScriptRuntime.specialRef(Object, String, Context, Scriptable)` instead
  org.mozilla.javascript.ScriptRuntime.toObject(Context, Scriptable, Object, Class<?>) Use `ScriptRuntime.toObject(Context, Scriptable, Object)` instead.
  org.mozilla.javascript.Context.toObject(Object, Scriptable, Class<?>)
  org.mozilla.javascript.ScriptRuntime.toObject(Scriptable, Object, Class<?>) Use `ScriptRuntime.toObject(Scriptable, Object)` instead.
  org.mozilla.javascript.ScriptRuntime.toObjectOrNull(Context, Object) Use `ScriptRuntime.toObjectOrNull(Context, Object, Scriptable)` instead
  org.mozilla.javascript.Context.toType(Object, Class<?>)
  org.mozilla.javascript.ScriptRuntime.typeError0(String) Use `ScriptRuntime.typeErrorById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.typeError1(String, Object) Use `ScriptRuntime.typeErrorById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.typeError2(String, Object, Object) Use `ScriptRuntime.typeErrorById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.typeError3(String, String, String, String) Use `ScriptRuntime.typeErrorById(String messageId, Object... args)` instead
  org.mozilla.javascript.ScriptRuntime.typeErrorThrower() `ScriptRuntime.typeErrorThrower(Context)`
  org.mozilla.javascript.WrappedException.unwrap() Use `WrappedException.getWrappedException()` instead.
  org.mozilla.javascript.NativeJavaObject.wrap(Scriptable, Object, Class<?>) Use `Context.getWrapFactory()` together with calling `WrapFactory.wrap(Context, Scriptable, Object, Class)`

- Deprecated Constructors
  Constructor and Description
  org.mozilla.javascript.Context() this constructor is deprecated because it creates a dependency on a static singleton context factory. Use `ContextFactory.enter()` or `ContextFactory.call(ContextAction)` instead. If you subclass this class, consider using `Context.Context(ContextFactory)` constructor instead in the subclasses' constructors.
  org.mozilla.javascript.EcmaError(Scriptable, String, int, int, String) EcmaError error instances should not be constructed explicitly since they are generated by the engine.
  org.mozilla.javascript.JavaScriptException(Object) Use `WrappedException.WrappedException(Throwable)` to report exceptions in Java code.
  org.mozilla.javascript.NativeJavaPackage(String) NativeJavaPackage is an internal class, do not use it directly.
  org.mozilla.javascript.NativeJavaPackage(String, ClassLoader) NativeJavaPackage is an internal class, do not use it directly.