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

Side by Side Diff: lib/src/protobuf/readonly_message.dart

Issue 1282103003: fix inconsistent firing of events for extension fields (Closed) Base URL: git@github.com:dart-lang/dart-protobuf.git@fieldtype
Patch Set: tweak a comment Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698