Skip to content

Commit 2ce742e

Browse files
committed
Merge pull request #101 from agruttner/agruttner_options
allow options of the form (google.protobuf.*).*
2 parents a07545e + d80cf59 commit 2ce742e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ProtoBuf.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,10 @@
746746
token = this.tn.next();
747747
}
748748
if (!Lang.NAME.test(token)) {
749-
throw(new Error("Illegal option name in message "+parent.name+" at line "+this.tn.line+": "+token));
749+
// we can allow options of the form google.protobuf.* since they will just get ignored anyways
750+
if (!/google\.protobuf\./.test(token)) {
751+
throw(new Error("Illegal option name in message "+parent.name+" at line "+this.tn.line+": "+token));
752+
}
750753
}
751754
var name = token;
752755
token = this.tn.next();
@@ -3715,4 +3718,4 @@
37153718
global["dcodeIO"]["ProtoBuf"] = loadProtoBuf(global["dcodeIO"]["ByteBuffer"]);
37163719
}
37173720

3718-
})(this);
3721+
})(this);

0 commit comments

Comments
 (0)