Skip to content

Commit

Permalink
Make PbMixin constructor public, bump version number to 0.5.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Slesinsky committed Jun 22, 2016
1 parent 7bc0bbb commit f7ee81e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 6 additions & 9 deletions lib/mixins_meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -36,8 +35,7 @@ class PbMixin {
/// May be null if the mixin doesn't reserve any new names.
final List<String> 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<PbMixin> findMixinsToApply() {
Expand All @@ -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"]);

Expand All @@ -88,6 +86,5 @@ const List<String> _reservedNamesForMap = const [
'values',
];

const _mapMixin = const PbMixin._raw("MapMixin",
importFrom: "dart:collection",
reservedNames: _reservedNamesForMap);
const _mapMixin = const PbMixin("MapMixin",
importFrom: "dart:collection", reservedNames: _reservedNamesForMap);
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: protobuf
version: 0.5.1+5
version: 0.5.2
author: Dart Team <[email protected]>
description: Runtime library for protobuf support.
homepage: https://github.com/dart-lang/dart-protobuf
Expand Down

0 comments on commit f7ee81e

Please sign in to comment.