| OLD | NEW |
| 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 /** Provides some basic model classes to test serialization. */ | 5 /** Provides some basic model classes to test serialization. */ |
| 6 | 6 |
| 7 part of serialization_test; | 7 part of serialization_test; |
| 8 | 8 |
| 9 class Person { | 9 class Person { |
| 10 String name, rank, serialNumber; | 10 String name, rank, serialNumber; |
| 11 var address; | 11 var address; |
| 12 } | 12 } |
| 13 | 13 |
| 14 class Address { | 14 class Address { |
| 15 String street, city, state, zip; | 15 String street, city, state, zip; |
| 16 Address(); |
| 17 Address.with(this.street, this.city, this.state, this.zip); |
| 16 } | 18 } |
| 17 | 19 |
| 18 class Various { | 20 class Various { |
| 19 Various.Foo(this._d, this.e); | 21 Various.Foo(this._d, this.e); |
| 20 | 22 |
| 21 // Field | 23 // Field |
| 22 var a; | 24 var a; |
| 23 | 25 |
| 24 // Get/Set pair | 26 // Get/Set pair |
| 25 var _b; | 27 var _b; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 class Stream { | 66 class Stream { |
| 65 // In a real stream the position wouldn't likely be settable, making | 67 // In a real stream the position wouldn't likely be settable, making |
| 66 // this trickier to reconstruct. | 68 // this trickier to reconstruct. |
| 67 List _collection; | 69 List _collection; |
| 68 int position = 0; | 70 int position = 0; |
| 69 Stream(this._collection); | 71 Stream(this._collection); |
| 70 | 72 |
| 71 next() => atEnd() ? null : _collection[position++]; | 73 next() => atEnd() ? null : _collection[position++]; |
| 72 atEnd() => position >= _collection.length; | 74 atEnd() => position >= _collection.length; |
| 73 } | 75 } |
| OLD | NEW |