[vm] protobuf aware treeshaker, Support freezing messages

This also bumps the protobuf version.

Change-Id: I3e2d4f8fddcac5f7ac213fbad5a36804d917e34c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101296
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
This commit is contained in:
Sigurd Meldgaard 2019-05-07 07:12:33 +00:00 committed by commit-bot@chromium.org
parent 3173e594ba
commit 4934f766d7
3 changed files with 25 additions and 2 deletions

2
DEPS
View file

@ -112,7 +112,7 @@ vars = {
"pedantic_tag": "v1.5.0",
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"pool_tag": "1.3.6",
"protobuf_rev": "0c77167b16d00b561a6055bfe26690af7f26ae88",
"protobuf_rev": "7d34c9e4e552a4f66acce32e4344ae27756a1949",
"pub_rev": "8c363fe26f059c3063f1129adbb3c4e22a8ce954",
"pub_semver_tag": "1.4.2",
"quiver-dart_tag": "2.0.0+1",

View file

@ -52,7 +52,7 @@ runTestCase(Uri source) async {
ProcessResult result =
Process.runSync(Platform.resolvedExecutable, [file.path]);
expect(result.exitCode, 0);
expect(result.exitCode, 0, reason: '${result.stderr}\n${result.stdout}');
} finally {
if (file.existsSync()) {
file.deleteSync();

View file

@ -0,0 +1,23 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test/test.dart';
import 'generated/foo.pb.dart';
main() {
FooKeep foo = FooKeep()
..barKeep = (BarKeep()..aKeep = 5)
..mapKeep['foo'] = (BarKeep()..aKeep = 2)
..aKeep = 43;
test('Freezing a message works', () {
foo.freeze();
expect(foo.barKeep.aKeep, 5);
expect(foo.mapKeep['foo'].aKeep, 2);
expect(foo.hasHasKeep(), false);
expect(foo.aKeep, 43);
expect(() => foo.clearClearKeep(),
throwsA(const TypeMatcher<UnsupportedError>()));
});
}