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
dart2js dart:html constructors taking Dictionary are not handled correctly. #7030
Comments
Added Area-Dart2JS, Triaged labels. |
Stephen, please bump it to a later milestone if you like. Set owner to @rakudrama. |
Looks like a DOM issue to me. Shouldn't this be in Area-HTML? |
I figured Stephen would know :-) |
I will leave the decision to blois@ whether the quick fix is M2 or M3. There are three problems here:
The quickest way to fix this is to write a custom constructor, and use the serialized script value conversion - it will be close enough. Fix all the classes listed below. +1 extra credit: fix the dictionary conversion to convert sublists and subdictionaries. +10 extra credit: make the generator handle this correctly. It should dispatch on the number of types and do the conversions. This is pretty much like a static member function with funky syntax. +100 extra credit: the compiler should recognize Dart literals that are being converted to JavaScript and convert them at compile time. There are four classes with this specific problem, and one with a related problem (Intent's constructor takes a SerializedScriptValue). Modules/intents/Intent.idl:30: Constructor(in DOMString action, in DOMString type, in [Optional=DefaultIsNullString, TransferList=transferList] SerializedScriptValue data, in [Optional=DefaultIsUndefined] Array transferList), Set owner to @blois. |
The first version of the fix described was implemented and committed in r18320 https://codereview.chromium.org//12217089. Further improvements can be opened as separate bugs. Added Fixed label. |
This issue was originally filed by sami.ylonen...@gmail.com
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Creating new RTCPeerConnection with literal map as parameter causes DOM exception when run as javascript.
dart code: new RTCPeerConnection({'iceServers': [ {'url':'stun:stun.l.google.com:19302'}]});
javascript code that fails:$.RTCPeerConnection_RTCPeerConnection($ .makeLiteralMap(["iceServers", [$.makeLiteralMap(["url", "stun:stun.l.google.com:19302"])]]), $);
manually fixed javascript code that works:$.RTCPeerConnection_RTCPeerConnection({'iceServers': [{'url': 'stun:stun.l.google.com:19302'}]}, $ );
What version of the product are you using? On what operating system?
Dart Editor version 0.2.6_r15355
Dart SDK version 0.2.6.0_r15355
Please provide any additional information below.
Same issue with other classes like RTCIceCandidate and RTCSessionDescription
The text was updated successfully, but these errors were encountered: