From f7ee81e5ac71699a371dbc5d273f2a244748fd0b Mon Sep 17 00:00:00 2001 From: Brian Slesinsky Date: Wed, 22 Jun 2016 12:22:35 -0700 Subject: [PATCH] Make PbMixin constructor public, bump version number to 0.5.2. R=skybrian@google.com Review URL: https://codereview.chromium.org//2090033002 . --- CHANGELOG.md | 4 ++++ lib/mixins_meta.dart | 15 ++++++--------- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08ccaeac4..84deda5a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.2 + +* make PbMixin constructor public for use within protoc plugin. + ## 0.5.1+5 * Revert previous change because it causes strong mode type error diff --git a/lib/mixins_meta.dart b/lib/mixins_meta.dart index 9812e9cf7..4ffa0dc6d 100644 --- a/lib/mixins_meta.dart +++ b/lib/mixins_meta.dart @@ -22,7 +22,6 @@ PbMixin findMixin(String name) { /// Only one mixin can be applied to each message, but that mixin can depend /// on another mixin, recursively, similar to single inheritance. class PbMixin { - /// The name of the mixin class to import into the .pb.dart file. final String name; @@ -36,8 +35,7 @@ class PbMixin { /// May be null if the mixin doesn't reserve any new names. final List reservedNames; - const PbMixin._raw(this.name, - {this.importFrom, this.parent, this.reservedNames}); + const PbMixin(this.name, {this.importFrom, this.parent, this.reservedNames}); /// Returns the mixin and its ancestors, in the order they should be applied. Iterable findMixinsToApply() { @@ -62,13 +60,13 @@ class PbMixin { } /// The mixins that findMixin() can return. -const _exportedMixins = const [_pbMapMixin, _pbEventMixin]; +final _exportedMixins = [_pbMapMixin, _pbEventMixin]; -const _pbMapMixin = const PbMixin._raw("PbMapMixin", +const _pbMapMixin = const PbMixin("PbMapMixin", importFrom: "package:protobuf/src/protobuf/mixins/map_mixin.dart", parent: _mapMixin); -const _pbEventMixin = const PbMixin._raw("PbEventMixin", +const _pbEventMixin = const PbMixin("PbEventMixin", importFrom: "package:protobuf/src/protobuf/mixins/event_mixin.dart", reservedNames: const ["changes", "deliverChanges"]); @@ -88,6 +86,5 @@ const List _reservedNamesForMap = const [ 'values', ]; -const _mapMixin = const PbMixin._raw("MapMixin", - importFrom: "dart:collection", - reservedNames: _reservedNamesForMap); +const _mapMixin = const PbMixin("MapMixin", + importFrom: "dart:collection", reservedNames: _reservedNamesForMap); diff --git a/pubspec.yaml b/pubspec.yaml index 3fcec58a7..0a13f216c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: protobuf -version: 0.5.1+5 +version: 0.5.2 author: Dart Team description: Runtime library for protobuf support. homepage: https://github.com/dart-lang/dart-protobuf