Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate Context#emptyArgs (see #1793) #1795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ private Object getObjectPropertyImpl(Context cx, Object object, Object id) {
/** Returns an array of the property names on the given script object. */
private Object[] getObjectIdsImpl(Context cx, Object object) {
if (!(object instanceof Scriptable) || object == Undefined.instance) {
return Context.emptyArgs;
return ScriptRuntime.emptyArgs;
}

Object[] ids;
Expand Down
8 changes: 6 additions & 2 deletions rhino/src/main/java/org/mozilla/javascript/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,12 @@ public class Context implements Closeable {
public static final String languageVersionProperty = "language version";
public static final String errorReporterProperty = "error reporter";

/** Convenient value to use as zero-length array of objects. */
public static final Object[] emptyArgs = ScriptRuntime.emptyArgs;
/**
* Convenient value to use as zero-length array of objects.
*
* @deprecated As of 1.8.1, use {@link ScriptRuntime#emptyArgs} instead.
*/
@Deprecated public static final Object[] emptyArgs = ScriptRuntime.emptyArgs;

/**
* Creates a new Context. The context will be associated with the {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Object get(Scriptable scope, String name, Object javaObject, boolean isStatic) {
if (member instanceof BeanProperty) {
BeanProperty bp = (BeanProperty) member;
if (bp.getter == null) return Scriptable.NOT_FOUND;
rval = bp.getter.invoke(javaObject, Context.emptyArgs);
rval = bp.getter.invoke(javaObject, ScriptRuntime.emptyArgs);
type = bp.getter.method().getReturnType();
} else {
Field field = (Field) member;
Expand Down
Loading