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

Unified Diff: lib/src/common/js_proxy.dart

Issue 1290643006: First cut at behaviors. This just implements the lifecycle methodsportion. We may get the rest for … (Closed) Base URL: git@github.com:dart-lang/polymer-dart.git@master
Patch Set: Created 5 years, 4 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: lib/src/common/js_proxy.dart
diff --git a/lib/src/common/js_proxy.dart b/lib/src/common/js_proxy.dart
index 3bc7b81b9b0d58a014aff3660140c55515ecaad8..276d378c81151c9c7db3165ed4a4dd2b94c97b6f 100644
--- a/lib/src/common/js_proxy.dart
+++ b/lib/src/common/js_proxy.dart
@@ -5,6 +5,7 @@ library polymer.lib.src.common.js_proxy;
import 'dart:js';
import 'package:reflectable/reflectable.dart';
+import 'behavior.dart';
import 'declarations.dart';
// Mixin this class to get js proxy support!
@@ -59,7 +60,12 @@ JsFunction _buildJsConstructorForType(Type dartType) {
var constructor = _polymerDart.callMethod('functionFactory');
var prototype = new JsObject(context['Object']);
- var declarations = declarationsFor(dartType, jsProxyReflectable);
+ var declarations = declarationsFor(
+ dartType, jsProxyReflectable, where: (name, declaration) {
+ // Skip declarations from [BehaviorProxy] classes. These should not
+ // read/write from the dart class.
+ return !declaration.owner.metadata.any((m) => m is BehaviorProxy);
Siggi Cherem (dart-lang) 2015/08/13 18:52:41 should we have a type to declare things that don't
jakemac 2015/08/13 19:14:29 Nothing else that I know of today, I think we can
+ });
declarations.forEach((String name, DeclarationMirror declaration) {
if (isProperty(declaration)) {
var descriptor = {

Powered by Google App Engine
This is Rietveld 408576698