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

Side by Side Diff: pkg/serialization/lib/src/serialization_rule.dart

Issue 11613005: Duplicate of https://chromiumcodereview.appspot.com/11567018/ (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix from review comment Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 4
5 part of serialization; 5 part of serialization;
6 6
7 // TODO(alanknight): We should have an example and tests for subclassing 7 // TODO(alanknight): We should have an example and tests for subclassing
8 // serialization rule rather than using the hard-coded ClosureToMap rule. And 8 // serialization rule rather than using the hard-coded ClosureToMap rule. And
9 // possibly an abstract superclass that's designed to be subclassed that way. 9 // possibly an abstract superclass that's designed to be subclassed that way.
10 /** 10 /**
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 pullStateFrom(Iterator stream) { 322 pullStateFrom(Iterator stream) {
323 var length = stream.next(); 323 var length = stream.next();
324 var ruleData = new List(); 324 var ruleData = new List();
325 for (var i = 0; i < length; i++) { 325 for (var i = 0; i < length; i++) {
326 ruleData.add(stream.next()); 326 ruleData.add(stream.next());
327 } 327 }
328 return ruleData; 328 return ruleData;
329 } 329 }
330 } 330 }
331 331
332 /** Helper function for PrimitiveRule to tell which objects it applies to. */
333 bool isPrimitive(object) {
334 return object is num || object is String || object is bool;
335 }
336
337 /** Typedef for the object construction closure used in ClosureRule. */ 332 /** Typedef for the object construction closure used in ClosureRule. */
338 typedef ConstructType(Map m); 333 typedef ConstructType(Map m);
339 334
340 /** Typedef for the state-getting closure used in ClosureToMapRule. */ 335 /** Typedef for the state-getting closure used in ClosureToMapRule. */
341 typedef Map<String, dynamic> GetStateType(object); 336 typedef Map<String, dynamic> GetStateType(object);
342 337
343 /** Typedef for the state-setting closure used in ClosureToMapRule. */ 338 /** Typedef for the state-setting closure used in ClosureToMapRule. */
344 typedef void NonEssentialStateType(object, Map m); 339 typedef void NonEssentialStateType(object, Map m);
345 340
346 /** 341 /**
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 sort([f]) => _throw(); 572 sort([f]) => _throw();
578 clear() => _throw(); 573 clear() => _throw();
579 removeAt(x) => _throw(); 574 removeAt(x) => _throw();
580 removeLast() => _throw(); 575 removeLast() => _throw();
581 getRange(x, y) => _throw(); 576 getRange(x, y) => _throw();
582 setRange(x, y, z, [a]) => _throw(); 577 setRange(x, y, z, [a]) => _throw();
583 removeRange(x, y) => _throw(); 578 removeRange(x, y) => _throw();
584 insertRange(x, y, [z]) => _throw(); 579 insertRange(x, y, [z]) => _throw();
585 void set length(x) => _throw(); 580 void set length(x) => _throw();
586 } 581 }
OLDNEW
« no previous file with comments | « pkg/serialization/lib/src/serialization_helpers.dart ('k') | pkg/serialization/test/polyfill_identity_map_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698