Skip to content

Commit 799d030

Browse files
committed
Other: In fromObject, check if object is already a runtime message, see #652
1 parent ea3f3b4 commit 799d030

24 files changed

+194
-47
lines changed

cli/targets/static.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ function beautifyCode(code) {
203203

204204
function buildFunction(type, functionName, gen, scope) {
205205
var code = gen.str(functionName)
206-
.replace(/\(this.ctor\)/g, " $root" + type.fullName) // types: construct directly instead of using reflected ctor
207-
.replace(/(types\[\d+])(\.values)/g, "$1") // enums: use types[N] instead of reflected types[N].values
208-
.replace(/\b(?!\.)Writer\b/g, "$Writer") // use common aliases instead of binding through an iife
209-
.replace(/\b(?!\.)Reader\b/g, "$Reader") // "
210-
.replace(/\b(?!\.)util\.\b/g, "$util.") // "
211-
.replace(/\b(?!\.)types\[\b/g, "$types["); // "
206+
.replace(/this\.ctor/g, " $root" + type.fullName) // types: construct directly instead of using reflected ctor
207+
.replace(/(types\[\d+])(\.values)/g, "$1") // enums: use types[N] instead of reflected types[N].values
208+
.replace(/\b(?!\.)Writer\b/g, "$Writer") // use common aliases instead of binding through an iife
209+
.replace(/\b(?!\.)Reader\b/g, "$Reader") // "
210+
.replace(/\b(?!\.)util\.\b/g, "$util.") // "
211+
.replace(/\b(?!\.)types\[\b/g, "$types["); // "
212212

213213
if (config.beautify)
214214
code = beautifyCode(code);

dist/noparse/protobuf.js

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/noparse/protobuf.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/noparse/protobuf.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/noparse/protobuf.min.js.gz

16 Bytes
Binary file not shown.

dist/noparse/protobuf.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.js

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js.gz

13 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)