Open
Description
Something about the proto3 marshaling code throws an exception in the generated code. I have put together this small reproduction of the issue: gopherjs-fail.zip
It throws this error (and stack trace):
gopherjs-fail.js:33783 Uncaught TypeError: structPointer_StringVal(...).$get is not a function
$packages.github.com/gogo/protobuf/proto.Buffer.ptr.enc_ref_string @ gopherjs-fail.js:33783method.
$expr @ gopherjs-fail.js:70
$packages.github.com/gogo/protobuf/proto.Buffer.ptr.enc_struct @ gopherjs-fail.js:33490
$packages.github.com/gogo/protobuf/proto.Buffer.ptr.Marshal @ gopherjs-fail.js:32260
$packages.github.com/gogo/protobuf/proto.Marshal @ gopherjs-fail.js:32188
$packages.gopherjs-fail.main @ gopherjs-fail.js:113711
$packages.gopherjs-fail.$init @ gopherjs-fail.js:113723
fun @ gopherjs-fail.js:1465
$goroutine @ gopherjs-fail.js:1463
$runScheduled @ gopherjs-fail.js:1504
Here's the code around line 33783:
Buffer.ptr.prototype.enc_ref_string = function(p, base) {
var $ptr, base, o, p, v;
o = this;
v = structPointer_StringVal(base, p.field).$get(); // <-- throws the exception
o.buf = $appendSlice(o.buf, p.tagcode);
o.EncodeStringBytes(v);
return $ifaceNil;
};
Not sure where to begin debugging this. 😦
Metadata
Metadata
Assignees
Labels
No labels