Skip to content

Commit

Permalink
Fixed reserved names re, also ensure valid service method names, see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 15, 2016
1 parent be3e0d9 commit 9b7b92a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function pushComment(lines) {
push(" */");
}

var reservedRe = /^do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof$/;
var reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;

function name(name) {
if (!name)
Expand Down Expand Up @@ -402,7 +402,7 @@ function buildService(ref, service) {
"@param {function(?Error, " + method.resolvedResponseType.fullName.substring(1) + "=)} callback Node-style callback called with the error, if any, and " + method.resolvedResponseType.name,
"@returns {undefined}"
]);
push(name(service.name) + ".prototype." + name(lcName) + " = function " + name(lcName) + "(request, callback) {");
push(name(service.name) + ".prototype[" + JSON.stringify(lcName) + "] = function " + name(lcName) + "(request, callback) {");
++indent;
push("var requestData;");
push("try {");
Expand Down

0 comments on commit 9b7b92a

Please sign in to comment.