Permalink
Browse files

Other: Statically generated services actually inherit from rpc.Service

  • Loading branch information...
dcodeIO committed Jan 20, 2017
1 parent 6ba8c72 commit 7299929b37267af2100237d4f8b4ed8610b9f7e1
@@ -550,22 +550,15 @@ function buildService(ref, service) {
"Constructs a new " + service.name + " service.",
service.comment ? "@classdesc " + service.comment : null,
"@exports " + fullName,
"@extends $protobuf.util.EventEmitter",
"@extends $protobuf.rpc.Service",
"@constructor",
"@param {RPCImpl} rpc RPC implementation",
"@param {RPCImpl} rpcImpl RPC implementation",
"@param {boolean} [requestDelimited=false] Whether requests are length-delimited",
"@param {boolean} [responseDelimited=false] Whether responses are length-delimited",
"@param {boolean} [responseDelimited=false] Whether responses are length-delimited"
]);
push("function " + name(service.name) + "(rpc, requestDelimited, responseDelimited) {");
push("function " + name(service.name) + "(rpcImpl, requestDelimited, responseDelimited) {");
++indent;
push("$util.EventEmitter.call(this);");
push("");
pushComment([
"RPC implementation.",
"@type {RPCImpl}"
]);
push("this.rpc = rpc;");
push("$protobuf.rpc.Service.call(this, rpcImpl);");
push("");
pushComment([
"Whether requests are length-delimited.",
@@ -581,12 +574,12 @@ function buildService(ref, service) {
--indent;
push("}");
push("");
push("(" + name(service.name) + ".prototype = Object.create($util.EventEmitter.prototype)).constructor = " + name(service.name) + ";");
push("(" + name(service.name) + ".prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = " + name(service.name) + ";");
if (config.create) {
push("");
pushComment([
"Creates a runtime service using the specified rpc implementation.",
"Creates new " + service.name + " service using the specified rpc implementation.",
"@param {RPCImpl} rpcImpl RPC implementation",
"@param {boolean} [requestDelimited=false] Whether requests are length-delimited",
"@param {boolean} [responseDelimited=false] Whether responses are length-delimited",

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +6 Bytes (100%) dist/light/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +100 Bytes (100%) dist/minimal/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +2 Bytes (100%) dist/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -32,7 +32,7 @@
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js tests/node/*.js",
"coverage-ci": "npm run coverage && cat coverage/lcov.info | coveralls",
"docs": "jsdoc -c jsdoc.docs.json -R README.md",
"lint": "eslint src light minimal",
"lint": "eslint src",
"pages": "node scripts/pages",
"prepublish": "node scripts/prepublish",
"postinstall": "node scripts/postinstall",
@@ -26,6 +26,11 @@ var fs = require("fs"),
var pathToProtobufjs = path.relative(path.dirname(out), "minimal").replace(/\\/g, "/");
fs.writeFileSync(out, fs.readFileSync(out).toString("utf8").replace(/"protobufjs\/minimal"/g, JSON.stringify(pathToProtobufjs)), "utf8");
process.stdout.write("pbjs: " + file + " -> " + out + "\n");
try {
require(path.join(__dirname, "..", out));
} catch (err2) {
process.stderr.write("ERROR: " + err2.message + "\n");
}
})
});
Oops, something went wrong.

0 comments on commit 7299929

Please sign in to comment.