| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 protobuf; | 5 part of protobuf; |
| 6 | 6 |
| 7 final _emptyList = new List.unmodifiable([]); | 7 final _emptyList = new List.unmodifiable([]); |
| 8 | 8 |
| 9 /// Modifies a GeneratedMessage so that it's read-only. | 9 /// Modifies a GeneratedMessage so that it's read-only. |
| 10 abstract class ReadonlyMessageMixin { | 10 abstract class ReadonlyMessageMixin { |
| 11 static final _emptyUnknownFields = new _ReadonlyUnknownFieldSet(); | 11 static final _emptyUnknownFields = new _ReadonlyUnknownFieldSet(); |
| 12 | 12 |
| 13 BuilderInfo get info_; | 13 BuilderInfo get info_; |
| 14 | 14 |
| 15 get unknownFields => _emptyUnknownFields; | 15 get unknownFields => _emptyUnknownFields; |
| 16 | 16 |
| 17 List _getDefaultRepeatedField(int tagNumber, List value) => _emptyList; | 17 List _getDefaultRepeatedField(int tagNumber, List value, Extension ext) => |
| 18 _emptyList; |
| 18 | 19 |
| 19 void addExtension(Extension extension, var value) => | 20 void addExtension(Extension extension, var value) => |
| 20 _readonly("addExtension"); | 21 _readonly("addExtension"); |
| 21 | 22 |
| 22 void clear() => _readonly("clear"); | 23 void clear() => _readonly("clear"); |
| 23 | 24 |
| 24 void clearExtension(Extension extension) => _readonly("clearExtension"); | 25 void clearExtension(Extension extension) => _readonly("clearExtension"); |
| 25 | 26 |
| 26 void clearField(int tagNumber) => _readonly("clearField"); | 27 void clearField(int tagNumber) => _readonly("clearField"); |
| 27 | 28 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 UnknownFieldSetField _getField(int number) { | 92 UnknownFieldSetField _getField(int number) { |
| 92 _readonly("a merge method"); | 93 _readonly("a merge method"); |
| 93 return null; // not reached | 94 return null; // not reached |
| 94 } | 95 } |
| 95 | 96 |
| 96 void _readonly(String methodName) { | 97 void _readonly(String methodName) { |
| 97 throw new UnsupportedError( | 98 throw new UnsupportedError( |
| 98 "attempted to call $methodName on a read-only UnknownFieldSet"); | 99 "attempted to call $methodName on a read-only UnknownFieldSet"); |
| 99 } | 100 } |
| 100 } | 101 } |
| OLD | NEW |