Skip to content

Commit

Permalink
New: Upgrade to codegen 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Apr 23, 2017
1 parent 13bf9c2 commit 17c2797
Show file tree
Hide file tree
Showing 40 changed files with 655 additions and 592 deletions.
2 changes: 1 addition & 1 deletion cli/lib/tsd-jsdoc/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function getTypeOf(element) {
});

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

// Convert plain Object back to just object
name = name.replace(/\b(Object(?!\.))/g, function($0, $1) {
Expand Down
5 changes: 3 additions & 2 deletions cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ var renameVars = {
};

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

var ast = espree.parse(code);
Expand Down Expand Up @@ -635,7 +635,8 @@ function buildEnum(ref, enm) {
push("");
var comment = [
enm.comment || enm.name + " enum.",
"@enum {number} " + exportName(enm)
enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : undefined,
"@enum {number}",
];
Object.keys(enm.values).forEach(function(key) {
var val = enm.values[key];
Expand Down
227 changes: 75 additions & 152 deletions dist/light/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/light/protobuf.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/light/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/light/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/light/protobuf.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/minimal/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17c2797

Please sign in to comment.