mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix Chrome RDP backend
This commit is contained in:
parent
f69e3310a3
commit
0cdf960ba5
|
@ -465,18 +465,22 @@ public class ChromeRDPDebugger implements JavaScriptDebugger, ChromeRDPExchangeC
|
||||||
for (PropertyDescriptorDTO property : properties) {
|
for (PropertyDescriptorDTO property : properties) {
|
||||||
RemoteObjectDTO remoteValue = property.getValue();
|
RemoteObjectDTO remoteValue = property.getValue();
|
||||||
RDPValue value;
|
RDPValue value;
|
||||||
switch (remoteValue.getType()) {
|
if (remoteValue != null && remoteValue.getType() != null) {
|
||||||
case "undefined":
|
switch (remoteValue.getType()) {
|
||||||
value = new RDPValue(this, "undefined", "undefined", null, false);
|
case "undefined":
|
||||||
break;
|
value = new RDPValue(this, "undefined", "undefined", null, false);
|
||||||
case "object":
|
break;
|
||||||
case "function":
|
case "object":
|
||||||
value = new RDPValue(this, null, remoteValue.getType(), remoteValue.getObjectId(), true);
|
case "function":
|
||||||
break;
|
value = new RDPValue(this, null, remoteValue.getType(), remoteValue.getObjectId(), true);
|
||||||
default:
|
break;
|
||||||
value = new RDPValue(this, remoteValue.getValue().asText(), remoteValue.getType(),
|
default:
|
||||||
remoteValue.getObjectId(), false);
|
value = new RDPValue(this, remoteValue.getValue().asText(), remoteValue.getType(),
|
||||||
break;
|
remoteValue.getObjectId(), false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
value = new RDPValue(this, "null", "null", "null", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
RDPLocalVariable var = new RDPLocalVariable(property.getName(), value);
|
RDPLocalVariable var = new RDPLocalVariable(property.getName(), value);
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package org.teavm.samples.async;
|
package org.teavm.samples.async;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
@ -28,68 +27,62 @@ public final class AsyncProgram {
|
||||||
withoutAsync();
|
withoutAsync();
|
||||||
System.out.println();
|
System.out.println();
|
||||||
withAsync();
|
withAsync();
|
||||||
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final Object lock = new Object();
|
|
||||||
|
|
||||||
Thread t = new Thread(new Runnable(){
|
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
final Object lock = new Object();
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
doRun(lock);
|
doRun(lock);
|
||||||
} catch (InterruptedException ex){
|
} catch (InterruptedException ex) {
|
||||||
System.out.println(ex.getMessage());
|
System.out.println(ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, "Test Thread");
|
}, "Test Thread");
|
||||||
t.start();
|
t.start();
|
||||||
|
|
||||||
Thread t2 = new Thread(new Runnable(){
|
|
||||||
|
|
||||||
|
Thread t2 = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
doRun(lock);
|
doRun(lock);
|
||||||
} catch (InterruptedException ex){
|
} catch (InterruptedException ex) {
|
||||||
System.out.println(ex.getMessage());
|
System.out.println(ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, "Test Thread 2");
|
}, "Test Thread 2");
|
||||||
t2.start();
|
t2.start();
|
||||||
System.out.println("Should be main -> Current thread is "+Thread.currentThread().getName());
|
|
||||||
|
System.out.println("Should be main -> Current thread is " + Thread.currentThread().getName());
|
||||||
System.out.println("Now trying wait...");
|
System.out.println("Now trying wait...");
|
||||||
|
|
||||||
lock.wait(20000);
|
lock.wait(20000);
|
||||||
System.out.println("Finished waiting");
|
System.out.println("Finished waiting");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void doRun(Object lock) throws InterruptedException {
|
private static void doRun(Object lock) throws InterruptedException {
|
||||||
System.out.println("Current thread is "+Thread.currentThread().getName());
|
System.out.println("Current thread is " + Thread.currentThread().getName());
|
||||||
System.out.println("Executing timer task");
|
System.out.println("Executing timer task");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
System.out.println("Current thread is "+Thread.currentThread().getName());
|
System.out.println("Current thread is " + Thread.currentThread().getName());
|
||||||
System.out.println("Calling lock.notify()");
|
System.out.println("Calling lock.notify()");
|
||||||
lock.notify();
|
lock.notify();
|
||||||
System.out.println("Current thread is "+Thread.currentThread().getName());
|
System.out.println("Current thread is " + Thread.currentThread().getName());
|
||||||
System.out.println("Finished calling lock.notify()");
|
System.out.println("Finished calling lock.notify()");
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
System.out.println("Current thread is "+Thread.currentThread().getName());
|
System.out.println("Current thread is " + Thread.currentThread().getName());
|
||||||
System.out.println("Finished another 5 second sleep");
|
System.out.println("Finished another 5 second sleep");
|
||||||
|
|
||||||
synchronized(lock){
|
synchronized (lock) {
|
||||||
System.out.println("Inside locked section of thread "+Thread.currentThread().getName());
|
System.out.println("Inside locked section of thread " + Thread.currentThread().getName());
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
System.out.println("Finished locked section of thread "+Thread.currentThread().getName());
|
System.out.println("Finished locked section of thread " + Thread.currentThread().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void withoutAsync() {
|
private static void withoutAsync() {
|
||||||
System.out.println("Start sync");
|
System.out.println("Start sync");
|
||||||
for (int i = 0; i < 20; ++i) {
|
for (int i = 0; i < 20; ++i) {
|
||||||
|
@ -117,7 +110,7 @@ public final class AsyncProgram {
|
||||||
}
|
}
|
||||||
System.out.println("2nd Thread.sleep in same method");
|
System.out.println("2nd Thread.sleep in same method");
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
|
|
||||||
System.out.println("Complete async");
|
System.out.println("Complete async");
|
||||||
|
|
||||||
System.out.println("Throwing exception");
|
System.out.println("Throwing exception");
|
||||||
|
@ -133,6 +126,5 @@ public final class AsyncProgram {
|
||||||
System.out.println("Thread.yield called");
|
System.out.println("Thread.yield called");
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user