-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MessageEvent throws an exception when trying to access data field and it's an object #1183
Comments
Removed the owner. |
This comment was originally written by antonm@google.com Apparently Dartium can cope with serialized values and we support a fair share if not all of those. Not tested though. |
This comment was originally written by shyc201...@gmail.com For now I think we can JSON.stringify the object before sending and JSON.parse it after receiving it. But I'm still waiting for full support in Dart. It shouldn't be too hard if Dartium has implemented the HTML5 structured clone algorithm. Or is it? |
Issue #3363 has been merged into this issue. cc @rakudrama. |
Issue #1444 has been merged into this issue. |
This comment was originally written by shy...@gmail.com I don't think #5369 is related to this bug. And I can confirm e.data is still not working with objects in Dartium Version 24.0.1290.0 (160763). |
This issue was originally filed by dpetroff...@gmail.com
I send a message via postMessage to the window from javascript code and to receive it from the dart code. If I send a string message, dart code can access data field from MessageEvent without any problems. But If I send an object with postMessage, any access to data field causes exception.
JS code:
window.addEventListener('message', function(ev) {
if (ev.data == 'init') {
console.log(arguments);
window.postMessage({some: 'message from js'}, '*');
};
});
Dart code:
window.on.message.add((ev) {
if (ev.data != 'init') {
window.console.log(ev.data);
window.console.log(ev.data.some);
}
});
window.postMessage('init', '*');
Console output:
MessageEvent
Uncaught TypeError: Object #<Object> has no method 'ptr$htmlimpl0a8e4b$$getter'
The text was updated successfully, but these errors were encountered: