Skip to content
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

Closed
DartBot opened this issue Jan 15, 2012 · 14 comments
Labels
closed-duplicate Closed in favor of an existing report web-libraries Issues impacting dart:html, etc., libraries
Milestone

Comments

@DartBot
Copy link

DartBot commented Jan 15, 2012

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'

@sigmundch
Copy link
Member

cc @vsmenon.
Added Area-UI, Triaged labels.

@vsmenon
Copy link
Member

vsmenon commented Apr 12, 2012

Removed Area-UI label.
Added Area-DOM label.

@vsmenon
Copy link
Member

vsmenon commented Jun 22, 2012

Need to determine the right semantics for this.


Set owner to @vsmenon.
Added this to the M1 milestone.

@iposva-google
Copy link
Contributor

Removed Area-DOM label.
Added Area-HTML label.

@vsmenon
Copy link
Member

vsmenon commented Aug 17, 2012

Removed the owner.

@vsmenon
Copy link
Member

vsmenon commented Aug 23, 2012

anton: do you know if dartium supports more than strings here?


Removed this from the M1 milestone.
Added this to the M2 milestone.

@DartBot
Copy link
Author

DartBot commented Aug 24, 2012

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.

@DartBot
Copy link
Author

DartBot commented Oct 4, 2012

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?

@blois
Copy link
Contributor

blois commented Oct 15, 2012

Removed this from the M2 milestone.
Added this to the Later milestone.

@blois
Copy link
Contributor

blois commented Oct 15, 2012

Issue #3363 has been merged into this issue.


cc @rakudrama.

@blois
Copy link
Contributor

blois commented Oct 15, 2012

Issue #1444 has been merged into this issue.

@blois
Copy link
Contributor

blois commented Oct 15, 2012

Removed this from the Later milestone.
Added this to the M2 milestone.

@blois
Copy link
Contributor

blois commented Oct 16, 2012

With bug #­5369 fixed, this should now be working.


Added Duplicate label.
Marked as being merged into #5369.

@DartBot
Copy link
Author

DartBot commented Oct 26, 2012

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).

@DartBot DartBot added Type-Defect web-libraries Issues impacting dart:html, etc., libraries closed-duplicate Closed in favor of an existing report labels Oct 26, 2012
@DartBot DartBot added this to the M2 milestone Oct 26, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

5 participants