Skip to content
Draft
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
6 changes: 6 additions & 0 deletions rhino/src/main/java/org/mozilla/javascript/WrapFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.mozilla.javascript;

import java.lang.reflect.AccessibleObject;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -119,6 +120,11 @@ public Scriptable wrapAsJavaObject(

public Scriptable wrapAsJavaObject(
Context cx, Scriptable scope, Object javaObject, TypeInfo staticType) {
if (javaObject instanceof AccessibleObject) {
// Field, Method, Constructor
return Undefined.SCRIPTABLE_UNDEFINED;
}

if (staticType.shouldReplace() && javaObject != null) {
staticType =
TypeInfoFactory.getOrElse(scope, TypeInfoFactory.GLOBAL)
Expand Down
Loading