| 1552 | // toHostTransferArg; without it a drawImage/pattern/attach arg crashes the |
| 1553 | // fire-and-forget postMessage with "function(){} could not be cloned". |
| 1554 | function cn1CleanRef(o) { |
| 1555 | if (o == null) { |
| 1556 | return o; |
| 1557 | } |
| 1558 | if (jvm && typeof jvm.toHostTransferArg === "function") { |
| 1559 | return jvm.toHostTransferArg(o); |
| 1560 | } |
| 1561 | if (o.__cn1HostRef != null) { |
| 1562 | return { __cn1HostRef: o.__cn1HostRef, __cn1HostClass: o.__cn1HostClass }; |
| 1563 | } |
| 1564 | return o; |
| 1565 | } |
| 1566 | |
| 1567 | bindNative([ |
| 1568 | "cn1_com_codename1_impl_html5_HTML5Implementation_nativeSurfaceCreate_int_int_int_R_void", |