Skip to content

Commit 17c2797

Browse files
committed
New: Upgrade to codegen 2
1 parent 13bf9c2 commit 17c2797

40 files changed

+655
-592
lines changed

cli/lib/tsd-jsdoc/publish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function getTypeOf(element) {
292292
});
293293

294294
// Replace functions (there are no signatures) with Function
295-
name = name.replace(/\bfunction(?:\(\))?([^\w]|$)/g, "Function");
295+
name = name.replace(/\bfunction(?:\(\))?\b/g, "Function");
296296

297297
// Convert plain Object back to just object
298298
name = name.replace(/\b(Object(?!\.))/g, function($0, $1) {

cli/targets/static.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ var renameVars = {
224224
};
225225

226226
function buildFunction(type, functionName, gen, scope) {
227-
var code = gen.str(functionName)
227+
var code = gen.toString(functionName)
228228
.replace(/((?!\.)types\[\d+])(\.values)/g, "$1"); // enums: use types[N] instead of reflected types[N].values
229229

230230
var ast = espree.parse(code);
@@ -635,7 +635,8 @@ function buildEnum(ref, enm) {
635635
push("");
636636
var comment = [
637637
enm.comment || enm.name + " enum.",
638-
"@enum {number} " + exportName(enm)
638+
enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : undefined,
639+
"@enum {number}",
639640
];
640641
Object.keys(enm.values).forEach(function(key) {
641642
var val = enm.values[key];

dist/light/protobuf.js

+75-152
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js.gz

-234 Bytes
Binary file not shown.

dist/light/protobuf.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)