Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: test/codegen/sunflower/dom.dart

Issue 1145833004: fixes #173, ability to use native JS indexers (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« test/codegen/domtest.dart ('K') | « test/codegen/expect/sunflower/dom.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/sunflower/dom.dart
diff --git a/test/codegen/sunflower/dom.dart b/test/codegen/sunflower/dom.dart
index e41c7561f8961bb21dd47998dd585a16ddec6f1e..fdbe3764b2e1fba2f92e59e04e217c96a39c8fc7 100644
--- a/test/codegen/sunflower/dom.dart
+++ b/test/codegen/sunflower/dom.dart
@@ -19,6 +19,10 @@ class Overload {
}
const overload = const Overload();
+class JsIndexer {
+ const JsIndexer();
+}
+
external Document get document;
@JsName(name: 'Document')
@@ -30,10 +34,27 @@ abstract class Document {
abstract class Element {
void addEventListener(String type, EventListener callback, [bool capture]);
String textContent;
+ NodeList get childNodes;
+}
+
+@JsName()
+class Node {}
+
+@JsName()
+@JsIndexer()
Jacob 2015/05/20 19:55:21 Seems a bit strange to have this annotation on the
Jennifer Messerly 2015/05/20 20:13:30 Hah, yeah, I wanted it that way too :). But we can
Jennifer Messerly 2015/06/01 17:36:58 Doh, I misunderstood your question. Restating the
+class NodeList {
+ external NodeList();
+ external num get length;
+ external set length(num _);
+ external Node item(num index);
+
+ external Node operator [](num index);
+ external void operator []=(num index, Node);
}
typedef void EventListener(Event e);
+@JsName()
abstract class Event {}
@JsName(name: 'HTMLInputElement')
« test/codegen/domtest.dart ('K') | « test/codegen/expect/sunflower/dom.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698