protobuf.js
protobuf.js copied to clipboard
not throw Error: illegal token ';' when loadSync with about 30+ proto files
protobuf.js version: 7.2.5 node v19.2.0
i have a proto test_bad.proto with two ";":
package awesomepackage;
message AwesomeMessage {
optional string awesome_field = 1;; // here!!!!
}
run the blew code ,will give "Error: illegal token ';' " , it's ok
let root = new protobuf.Root();
root.loadSync('test_bad.proto')
but when loadSync with about 30+ files , protobufjs not throw any error, code here:
let arr = []
for(let i = 0; i<30 ;i++){
arr.push("test_" + i + ".proto" ) //these are good proto, without two ";;"
}
arr.push("test_bad.proto")
let root = new protobuf.Root();
root.loadSync(arr) //not throw error here!
please help