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

Side by Side Diff: lib/src/common/js_proxy.dart

Issue 1351693003: Update to use one less proxy per element (Closed) Base URL: git@github.com:dart-lang/polymer-dart.git@behaviors
Patch Set: update comments Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « lib/polymer.html ('k') | lib/src/common/polymer_descriptor.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library polymer.lib.src.common.js_proxy; 4 library polymer.lib.src.common.js_proxy;
5 5
6 import 'dart:js'; 6 import 'dart:js';
7 import 'package:polymer_interop/polymer_interop.dart'; 7 import 'package:polymer_interop/polymer_interop.dart';
8 export 'package:polymer_interop/polymer_interop.dart' show dartValue, jsValue; 8 export 'package:polymer_interop/polymer_interop.dart' show dartValue, jsValue;
9 import 'package:reflectable/reflectable.dart'; 9 import 'package:reflectable/reflectable.dart';
10 import 'behavior.dart'; 10 import 'behavior.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 : super( 61 : super(
62 instanceInvokeCapability, 62 instanceInvokeCapability,
63 metadataCapability, 63 metadataCapability,
64 declarationsCapability, 64 declarationsCapability,
65 typeCapability, 65 typeCapability,
66 typeRelationsCapability, 66 typeRelationsCapability,
67 subtypeQuantifyCapability, 67 subtypeQuantifyCapability,
68 superclassQuantifyCapability, 68 superclassQuantifyCapability,
69 const StaticInvokeCapability('hostAttributes')); 69 const StaticInvokeCapability('hostAttributes'));
70 } 70 }
71
72 const jsProxyReflectable = const JsProxyReflectable(); 71 const jsProxyReflectable = const JsProxyReflectable();
73 72
74 final JsObject _polymerDart = context['Polymer']['Dart']; 73 final JsObject _polymerDart = context['Polymer']['Dart'];
75 74
76 /// Given a dart type, this creates a javascript constructor and prototype 75 /// Given a dart type, this creates a javascript constructor and prototype
77 /// which can act as a proxy for it. 76 /// which can act as a proxy for it.
78 JsFunction _buildJsConstructorForType(Type dartType) { 77 JsFunction _buildJsConstructorForType(Type dartType) {
79 var constructor = _polymerDart.callMethod('functionFactory'); 78 var constructor = _polymerDart.callMethod('functionFactory');
80 var prototype = new JsObject(context['Object']); 79 var prototype = new JsObject(context['Object']);
81 80
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 var mirror = jsProxyReflectable.reflect(dartInstance); 116 var mirror = jsProxyReflectable.reflect(dartInstance);
118 return jsValue(mirror.invoke(name, newArgs)); 117 return jsValue(mirror.invoke(name, newArgs));
119 } 118 }
120 ]); 119 ]);
121 } 120 }
122 }); 121 });
123 122
124 constructor['prototype'] = prototype; 123 constructor['prototype'] = prototype;
125 return constructor; 124 return constructor;
126 } 125 }
OLDNEW
« no previous file with comments | « lib/polymer.html ('k') | lib/src/common/polymer_descriptor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698