Skip to content
Open
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 @@ -36,6 +36,7 @@ public abstract class ScriptableBase extends ScriptableObject {

public static final String JSFUNC_PREFIX = "jsFunction_";

/** Not thread-safe: designed for use in single-threaded environments only. */
protected Object getNative(String name, Scriptable start) {
final Object wrapped = getWrappedObject();

Expand All @@ -48,11 +49,7 @@ protected Object getNative(String name, Scriptable start) {
}

if (njo == null) {
synchronized (this) {
if (njo == null) {
njo = new NativeJavaObject(start, wrapped, getStaticType());
}
}
njo = new NativeJavaObject(start, wrapped, getStaticType());
}

return njo.get(name, start);
Expand Down