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

Unified Diff: pkg/polymer/lib/src/events.dart

Issue 317013007: Detect and wrap JS-CustomEvents if applicable. Include created_watcher and (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: pkg/polymer/lib/src/events.dart
diff --git a/pkg/polymer/lib/src/events.dart b/pkg/polymer/lib/src/events.dart
index 503445fbf827ac91cb9ba0ea4a97d555adb80c2c..1817658405ec4e86e2c17c09a8dee77abad1fa1e 100644
--- a/pkg/polymer/lib/src/events.dart
+++ b/pkg/polymer/lib/src/events.dart
@@ -57,7 +57,16 @@ abstract class PolymerEventBindings {
}
if (controller is Polymer) {
- var args = [e, e.detail, e.currentTarget];
+ var detail = null;
+ if (e is CustomEvent) {
Siggi Cherem (dart-lang) 2014/06/06 22:42:24 this part was a regression, I think (we used to ch
Jennifer Messerly 2014/06/09 16:54:37 ah, right... it should've been: var detail =
Siggi Cherem (dart-lang) 2014/06/10 01:39:34 I think that's OK. The current test I'm adding sho
+ detail = e.detail;
+ // Dart note: to improve interop with polymer.js elements, we try to
+ // proxy any js detail objects.
+ if (detail == null) {
justinfagnani 2014/06/06 23:37:05 I'm confused by this, are the Dart detail and the
Jennifer Messerly 2014/06/09 16:54:37 for some reason, CustomEvent is a bit wacky in dar
Siggi Cherem (dart-lang) 2014/06/10 01:39:34 Seems like the scenario I hit when wrapping a core
+ detail = new JsObject.fromBrowserObject(e)['detail'];
+ }
+ }
+ var args = [e, detail, e.currentTarget];
controller.dispatchMethod(controller, method, args);
} else {
throw new StateError('controller $controller is not a '

Powered by Google App Engine
This is Rietveld 408576698