protobuf.js icon indicating copy to clipboard operation
protobuf.js copied to clipboard

not throw Error: illegal token ';' when loadSync with about 30+ proto files

Open zxt5105515 opened this issue 2 years ago • 0 comments

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

zxt5105515 avatar Sep 21 '23 11:09 zxt5105515