aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-04-20 10:52:31 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-04-20 10:52:31 -0700
commit18997430ddefe0fe8db6888b8c466e4eca6198f7 (patch)
tree4c8498667ef705f8fe3e26abf31f01d5c2076cc0 /src/compiler
parentf8d7747ddd0f947c74d137f843cc32bde0e91eb3 (diff)
Use math test to test generated code
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/node_generator.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc
index 03e1314f7b..822622cccf 100644
--- a/src/compiler/node_generator.cc
+++ b/src/compiler/node_generator.cc
@@ -138,7 +138,7 @@ void PrintMessageTransformer(const Descriptor *descriptor, Printer *out) {
out->Print("}\n");
out->Print("return new Buffer(arg.serializeBinary());\n");
out->Outdent();
- out->Print("}\n");
+ out->Print("}\n\n");
// Print the deserializer
out->Print(template_vars,
@@ -148,7 +148,7 @@ void PrintMessageTransformer(const Descriptor *descriptor, Printer *out) {
template_vars,
"return $node_name$.deserializeBinary(new Uint8Array(buffer_arg));\n");
out->Outdent();
- out->Print("}\n");
+ out->Print("}\n\n");
}
void PrintMethod(const MethodDescriptor *method, Printer *out) {
@@ -212,6 +212,8 @@ grpc::string GetImports(const FileDescriptor *file) {
out.Print("// GENERATED CODE -- DO NOT EDIT!\n\n");
+ out.Print("'use strict';\n");
+
out.Print("var grpc = require('grpc');\n");
if (file->message_type_count() > 0) {
grpc::string file_path = GetRelativePath(file->name(),