MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / cn1CleanRef

Function cn1CleanRef

Ports/JavaScriptPort/src/main/webapp/port.js:1554–1565  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

1552// toHostTransferArg; without it a drawImage/pattern/attach arg crashes the
1553// fire-and-forget postMessage with "function(){} could not be cloned".
1554function 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
1567bindNative([
1568 "cn1_com_codename1_impl_html5_HTML5Implementation_nativeSurfaceCreate_int_int_int_R_void",

Callers 1

port.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected