DK
Size: a a a
DK
A
DK
A
DK
DK
Context context = Context.create();
context.eval("js", polyfillContents);
context.eval(Source.newBuilder("js", componentReader, componentSourceName).build());
A
A
OS
// Could move this to a file if desired
private static final String polyfillContents = "var window = this; " +
"window.setTimeout = function (){}; " +
"window.clearTimeout = function (){};";
DK
OS
OS
DK
DK
DK
OS
class WindowPolyfill {
public void setTimeout(Supplier f, long ms) throws Exception {
Thread.currentThread().sleep(ms);
f.get();
}
}
OS
OS
OS
OS