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

Unified Diff: lib/src/common/polymer_serialize.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, 3 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
« no previous file with comments | « lib/src/common/polymer_mixin.dart ('k') | lib/src/js/polymer_array_methods.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/common/polymer_serialize.dart
diff --git a/lib/src/common/polymer_serialize.dart b/lib/src/common/polymer_serialize.dart
index 31efa5bf7fb7f33bf46a0946dafaed8eb1a34be3..9d90de7d786881affb3b38cae15e5bb86ffa560e 100644
--- a/lib/src/common/polymer_serialize.dart
+++ b/lib/src/common/polymer_serialize.dart
@@ -18,15 +18,18 @@ abstract class PolymerSerialize implements PolymerMixin {
JsObject get jsElement;
/// Serializes the [value] into a [String].
- String serialize(Object value) {
- var result = jsElement.callMethod('originalSerialize', [jsValue(value)]);
+ String serialize(value) {
+ var result = _polymerDartSerialize.apply([jsValue(value)]);
return (result != null) ? result.toString() : null;
}
/// Deserializes the [value] into an object of the given [type].
dynamic deserialize(String value, Type type) {
- return dartValue(jsElement.callMethod(
- 'originalDeserialize', [jsValue(value), jsType(type)]));
+ return dartValue(_polymerDartDeserialize.apply([value, jsType(type)]));
}
}
+
+final JsObject _polymer = context['Polymer'];
+final JsFunction _polymerDartSerialize = _polymer['Dart']['serialize'];
+final JsFunction _polymerDartDeserialize = _polymer['Dart']['deserialize'];
« no previous file with comments | « lib/src/common/polymer_mixin.dart ('k') | lib/src/js/polymer_array_methods.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698