Fix MessageEvent.data to convert using structured clone.

BUG=

Review URL: https://codereview.chromium.org/1683403005 .
This commit is contained in:
Alan Knight 2016-02-11 13:05:53 -08:00
parent c4602b0c8b
commit f2fd68c362
2 changed files with 18 additions and 3 deletions

View file

@ -26122,8 +26122,12 @@ class MessageEvent extends Event {
@DomName('MessageEvent.data')
@DocsEditable()
Object get data => wrap_jso(_blink.BlinkMessageEvent.instance.data_Getter_(unwrap_jso(this)));
// TODO(alanknight): This really should be generated by the
// _OutputConversion in the systemnative.py script, but that doesn't
// use those conversions right now, so do this as a one-off.
dynamic get data => convertNativeToDart_SerializedScriptValue(
_blink.BlinkMessageEvent.instance.data_Getter_(unwrap_jso(this)));
@DomName('MessageEvent.lastEventId')
@DocsEditable()
@Unstable()

View file

@ -21,11 +21,22 @@ $if DART2JS
type, canBubble, cancelable, data, origin, lastEventId, source,
messagePorts);
}
$endif
$endif
var event = document._createEvent("MessageEvent");
event._initMessageEvent(type, canBubble, cancelable, data, origin,
lastEventId, source, messagePorts);
return event;
}
$if DARTIUM
// TODO(alanknight): This really should be generated by the
// _OutputConversion in the systemnative.py script, but that doesn't
// use those conversions right now, so do this as a one-off.
@DomName('MessageEvent.data')
@DocsEditable()
dynamic get data => convertNativeToDart_SerializedScriptValue(
_blink.BlinkMessageEvent.instance.data_Getter_(unwrap_jso(this)));
$endif
$!MEMBERS
}