tuarua / WebViewANE

WebView Adobe Air Native Extension for macOS 10.10+, Windows Desktop, iOS 9.0+ and Android 19+. This ANE provides access to a more modern webview from AIR.
Apache License 2.0
183 stars 53 forks source link

addCallback("jsFunctionName", asFunction) - errors cannot be catched at asFunction by AIR Debug Launcher #301

Closed ylazy closed 2 years ago

ylazy commented 2 years ago
_webView.addCallback("jsFunctionName", asFunction);

function asFunction(input:ActionscriptCallback):void
{
// if there are any errors here, they cannot be caught by the AIR Debug Launcher.
// instead, there're error traces on the Output panel, but there aren't any line number or class name information, like this:
// Error #1010: A term is undefined and has no properties.
}
tuarua commented 2 years ago

The error is caught inside the ANE AS code. So is working correctly. https://github.com/tuarua/WebViewANE/blob/e6f5f7dbf35c59f06daa7703a29bd95c9aecf74c/native_extension/src/com/tuarua/WebViewANEContext.as#L164

The problems is likely down to you not implementing the message from JS > AS properly. See the examples. https://github.com/tuarua/WebViewANE/blob/e6f5f7dbf35c59f06daa7703a29bd95c9aecf74c/example-desktop-complete/src/jsTest.html#L41

I have to close as this is not a bug with the ANE