| 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 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 operator [](x) => _reader.inflateReference(_raw[x]); | 528 operator [](x) => _reader.inflateReference(_raw[x]); |
| 529 | 529 |
| 530 int get length => _raw.length; | 530 int get length => _raw.length; |
| 531 bool get isEmpty => _raw.isEmpty; | 531 bool get isEmpty => _raw.isEmpty; |
| 532 bool get isNotEmpty => _raw.isNotEmpty; | 532 bool get isNotEmpty => _raw.isNotEmpty; |
| 533 Iterable get keys => _raw.keys; | 533 Iterable get keys => _raw.keys; |
| 534 bool containsKey(x) => _raw.containsKey(x); | 534 bool containsKey(x) => _raw.containsKey(x); |
| 535 | 535 |
| 536 // These operations will work, but may be expensive, and are probably | 536 // These operations will work, but may be expensive, and are probably |
| 537 // best avoided. | 537 // best avoided. |
| 538 get _inflated => keysAndValues(_raw).map(_reader.inflateReference); | 538 get _inflated => mapValues(_raw, _reader.inflateReference); |
| 539 bool containsValue(x) => _inflated.containsValue(x); | 539 bool containsValue(x) => _inflated.containsValue(x); |
| 540 Iterable get values => _inflated.values; | 540 Iterable get values => _inflated.values; |
| 541 void forEach(f) => _inflated.forEach(f); | 541 void forEach(f) => _inflated.forEach(f); |
| 542 | 542 |
| 543 // These operations are all invalid | 543 // These operations are all invalid |
| 544 _throw() { | 544 _throw() { |
| 545 throw new UnsupportedError("Not modifiable"); | 545 throw new UnsupportedError("Not modifiable"); |
| 546 } | 546 } |
| 547 operator []=(x, y) => _throw(); | 547 operator []=(x, y) => _throw(); |
| 548 putIfAbsent(x, y) => _throw(); | 548 putIfAbsent(x, y) => _throw(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 568 int get length => _raw.length; | 568 int get length => _raw.length; |
| 569 | 569 |
| 570 void set length(int value) => _throw(); | 570 void set length(int value) => _throw(); |
| 571 | 571 |
| 572 void operator []=(int index, value) => _throw(); | 572 void operator []=(int index, value) => _throw(); |
| 573 | 573 |
| 574 void _throw() { | 574 void _throw() { |
| 575 throw new UnsupportedError("Not modifiable"); | 575 throw new UnsupportedError("Not modifiable"); |
| 576 } | 576 } |
| 577 } | 577 } |
| OLD | NEW |