mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
fix(selector): UiObjectCollection.find() conflicts with Array.find()
This commit is contained in:
parent
af8823b10f
commit
16692dadf3
@ -39,7 +39,7 @@ runtime.init();
|
||||
arr.push(list.get(i));
|
||||
}
|
||||
for(var key in list){
|
||||
if(arr[key])
|
||||
if(typeof(key) == 'number')
|
||||
continue;
|
||||
var v = list[key];
|
||||
if(typeof(v) == 'function'){
|
||||
@ -104,7 +104,7 @@ runtime.init();
|
||||
importClass(android.view.KeyEvent);
|
||||
importClass(com.stardust.autojs.core.util.Shell);
|
||||
importClass(android.graphics.Paint);
|
||||
importClass(android.graphics.Canvas);
|
||||
Canvas = com.stardust.autojs.core.graphics.ScriptCanvas;
|
||||
|
||||
//重定向require以便支持相对路径
|
||||
(function(){
|
||||
|
||||
@ -165,8 +165,6 @@ public class RhinoJavaScriptEngine extends JavaScriptEngine {
|
||||
private class WrapFactory extends org.mozilla.javascript.WrapFactory {
|
||||
|
||||
|
||||
private ConcurrentHashMap<Class, NativeJavaClassWithPrototype> mJavaClasses = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public Object wrap(Context cx, Scriptable scope, Object obj, Class<?> staticType) {
|
||||
if (obj instanceof String) {
|
||||
@ -177,25 +175,6 @@ public class RhinoJavaScriptEngine extends JavaScriptEngine {
|
||||
}
|
||||
return super.wrap(cx, scope, obj, staticType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Scriptable wrapAsJavaObject(Context cx, Scriptable scope, Object javaObject, Class<?> staticType) {
|
||||
NativeJavaObjectWithPrototype obj = new NativeJavaObjectWithPrototype(scope, javaObject, staticType);
|
||||
NativeJavaClassWithPrototype clazz = mJavaClasses.get(obj.getClass());
|
||||
if (clazz == null) {
|
||||
clazz = (NativeJavaClassWithPrototype) wrapJavaClass(cx, scope, obj.getClass());
|
||||
}
|
||||
obj.setPrototype(clazz);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Scriptable wrapJavaClass(Context cx, Scriptable scope, Class<?> javaClass) {
|
||||
NativeJavaClassWithPrototype clazz = new NativeJavaClassWithPrototype(scope, javaClass);
|
||||
mJavaClasses.put(javaClass, clazz);
|
||||
return clazz;
|
||||
}
|
||||
}
|
||||
|
||||
private class InterruptibleAndroidContextFactory extends AndroidContextFactory {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user