Example of changing the HTML DOM structure with Java Bytecode
This commit is contained in:
commit
34ce88ee62
BIN
runtime/bicavm/browser/Window.class
Normal file
BIN
runtime/bicavm/browser/Window.class
Normal file
Binary file not shown.
5
runtime/bicavm/browser/Window.java
Normal file
5
runtime/bicavm/browser/Window.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package bicavm.browser;
|
||||||
|
|
||||||
|
public class Window{
|
||||||
|
public static native void setTitle(String title);
|
||||||
|
}
|
Binary file not shown.
@ -940,9 +940,9 @@ DEFOP(INVOKESTATIC)
|
|||||||
LOG("Calling " + className + " " + method.name_ref.str + method.descriptor_ref.str)
|
LOG("Calling " + className + " " + method.name_ref.str + method.descriptor_ref.str)
|
||||||
LOG("!! NATIVE !!")
|
LOG("!! NATIVE !!")
|
||||||
if (xl.jvm.internalJNITable[className] && methodId in xl.jvm.internalJNITable[className]){
|
if (xl.jvm.internalJNITable[className] && methodId in xl.jvm.internalJNITable[className]){
|
||||||
result = xl.jvm.internalJNITable[className][methodId].apply(cl,args);
|
result = {return_object: xl.jvm.internalJNITable[className][methodId].apply(cl,args)};
|
||||||
}else if (xl.jvm.JNITable[className] && methodId in xl.jvm.JNITable[className]){
|
}else if (xl.jvm.JNITable[className] && methodId in xl.jvm.JNITable[className]){
|
||||||
result = xl.jvm.JNITable[className][methodId].apply(cl,args)
|
result = {return_object: xl.jvm.JNITable[className][methodId].apply(cl,args)};s
|
||||||
}else{
|
}else{
|
||||||
PANIC(methodId + " declared as native but not mapped");
|
PANIC(methodId + " declared as native but not mapped");
|
||||||
}
|
}
|
||||||
@ -950,8 +950,8 @@ DEFOP(INVOKESTATIC)
|
|||||||
}else{
|
}else{
|
||||||
result = method.invoke(args,cl);
|
result = method.invoke(args,cl);
|
||||||
}
|
}
|
||||||
if (result != undefined){
|
if (result != undefined && result.return_object!= undefined){
|
||||||
OPPUSH(result);
|
OPPUSH(result.return_object);
|
||||||
}
|
}
|
||||||
ENDDEF
|
ENDDEF
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ function java_lang_Double_doubleToRawLongBits(d){
|
|||||||
return new math.Long(y[0],y[1]);
|
return new math.Long(y[0],y[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bicavm_browser_Window_setLocation(s){
|
function bicavm_browser_Window_setTitle(s){
|
||||||
window.document.title = javaString2JS(s);
|
window.document.title = javaString2JS(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user