Merge pull request #60 from dart-lang/tweaks
Tweaks
diff --git a/README.md b/README.md
index c700db7..24f493f 100644
--- a/README.md
+++ b/README.md
@@ -130,8 +130,8 @@
Useful references
-----------------
-* [Main Dart site](http://www.dartlang.org)
-* [Main protobuf site](https://code.google.com/p/protobuf)
+* [Main Dart site](https://www.dartlang.org/)
+* [Main protobuf site](https://github.com/google/protobuf)
* [Protobuf runtime support project](https://github.com/dart-lang/dart-protobuf)
* [DartEditor download](http://www.dartlang.org)
-* [Pub documentation](http://pub.dartlang.org/doc)
+* [Pub documentation](https://www.dartlang.org/tools/pub/get-started.html)
diff --git a/lib/service_generator.dart b/lib/service_generator.dart
index 811def2..e061240 100644
--- a/lib/service_generator.dart
+++ b/lib/service_generator.dart
@@ -166,7 +166,8 @@
out.addBlock("switch (method) {", "}", () {
for (MethodDescriptorProto m in _methodDescriptors) {
var methodName = _methodName(m.name);
- out.println("case '${m.name}': return $methodName(ctx, request);");
+ out.println(
+ "case '${m.name}': return this.$methodName(ctx, request);");
}
out.println("default: "
"throw new ArgumentError('Unknown method: \$method');");
diff --git a/test/file_generator_test.dart b/test/file_generator_test.dart
index 01ac8ee..0a9dbfd 100644
--- a/test/file_generator_test.dart
+++ b/test/file_generator_test.dart
@@ -371,7 +371,7 @@
Future<GeneratedMessage> handleCall(ServerContext ctx, String method, GeneratedMessage request) {
switch (method) {
- case 'Ping': return ping(ctx, request);
+ case 'Ping': return this.ping(ctx, request);
default: throw new ArgumentError('Unknown method: $method');
}
}
diff --git a/test/service_generator_test.dart b/test/service_generator_test.dart
index e26f9b9..a1c773e 100644
--- a/test/service_generator_test.dart
+++ b/test/service_generator_test.dart
@@ -28,8 +28,8 @@
Future<GeneratedMessage> handleCall(ServerContext ctx, String method, GeneratedMessage request) {
switch (method) {
- case 'AMethod': return aMethod(ctx, request);
- case 'AnotherMethod': return anotherMethod(ctx, request);
+ case 'AMethod': return this.aMethod(ctx, request);
+ case 'AnotherMethod': return this.anotherMethod(ctx, request);
default: throw new ArgumentError('Unknown method: $method');
}
}