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

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: redo! 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
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..0547500711bef2705551eac4d4aa7277d9a65aed 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(_polymerBaseDeserialize.apply([value, jsType(type)]));
}
}
+
+final JsObject _polymer = context['Polymer'];
+final JsFunction _polymerDartSerialize = _polymer['Dart']['serialize'];
+final JsFunction _polymerBaseDeserialize = _polymer['Base']['deserialize'];
Siggi Cherem (dart-lang) 2015/09/17 21:11:59 I guess here we'll need the workaround we discusse
jakemac 2015/09/23 17:37:08 yep

Powered by Google App Engine
This is Rietveld 408576698