-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add indexing operators for getter
and setter
attributes
#127
Comments
I've ran into this, too! CC @srujzs |
I'm surprised we don't emit some properties already: https://github.com/w3c/webref/blob/8d7678e1740d00c3b79ebf70013d0448b23e3c8b/ed/idl/html.idl#L161 It might be due to us not handling That being said, I don't think we can feasibly implement |
This one is a show stopper for me, I can't start the migration from 'dart:html' to 'web' until it gets fixed. |
Can you describe a bit more on what's affecting your migration? If it's the above indexing operators, you can define your own import 'dart:js_interop';
import 'dart:js_interop_unsafe';
extension on DOMStringMap {
external String operator [](String name);
external void operator []=(String name, String value);
void delete(String name) => this.delete(name.toJS);
} Matching the definition here: https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes:domstringmap-3. |
DOMStringMap
has no mechanism to add/remove/change valuesgetter
and setter
attributes
@srujzs I was looking into this issue and was wondering how I can approach this? Would the addition of |
I think ideally we'll want these in the generator as lots of types define them. The generator has enough layers that it may be a bit complicated to dive into. I'm working on adding this request, but the resulting PR may be useful as an example of how it works and we can chat on that PR. |
Sounds good! |
Closes dart-lang#127 The IDL defines unnamed getters or setters which should be emitted as special variants of the index operators.
DOMStringMap
, primarily returned byHTMLElement#dataset
does not provide any mechanism to set or access its values.Would be nice if it implemented something like
Map<String, String>
if that was possible :)See
web/tool/generator/translator.dart
Line 492 in e89fe49
The text was updated successfully, but these errors were encountered: