-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
The follow code gives ClassCastException in Chrome(Version 83.0.4103.61 (Official Build) (64-bit)) and new Edge(Version 83.0.478.37 (Official build) (64-bit)) but not Edge Legacy
private void setupMutation(Node target) {
Consumer<MutationRecord> recordConsumer = mutationRecord -> DomGlobal.console.log("oldValue", mutationRecord.oldValue);
MutationObserverInit mutationObserverInit = MutationObserverInit.create();
mutationObserverInit.setAttributes(true);
mutationObserverInit.setChildList(true);
mutationObserverInit.setSubtree(true);
MutationObserver mutationObserver = new MutationObserver(new MutationObserver.MutationObserverCallbackFn() {
public Object onInvoke(JsArray<MutationRecord> recordJsArray, MutationObserver observer) {
recordJsArray.forEach((recordConsumer1, ignore, params) -> {
recordConsumer.accept(recordConsumer1);
return null;
});
return null;
}
});
mutationObserver.observe(target, mutationObserverInit);
}
Below is the type check that fails for MutationObserver. In the console there is a test againt $wnd and window for the mutationRecord instance
And the generated code where castToNative is used.
Metadata
Metadata
Assignees
Labels
No labels