소스 검색

Switch to Buffer.from to avoid using deprecated constructor

Ben Sykes 7 년 전
부모
커밋
423ae6d013
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/compiler/node_generator.cc

+ 1 - 1
src/compiler/node_generator.cc

@@ -134,7 +134,7 @@ void PrintMessageTransformer(const Descriptor* descriptor, Printer* out) {
              "throw new Error('Expected argument of type $name$');\n");
   out->Outdent();
   out->Print("}\n");
-  out->Print("return new Buffer(arg.serializeBinary());\n");
+  out->Print("return Buffer.from(arg.serializeBinary());\n");
   out->Outdent();
   out->Print("}\n\n");