aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-doc
diff options
context:
space:
mode:
authorF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-09-24 22:21:12 +0800
committerF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-09-25 00:29:02 +0800
commit880cd6e440c76d819cdb04d2971375cf9e0ea97b (patch)
treee9966bdf36c101355265b67b8fd71feaa770d86a /packages/sol-doc
parent98d06d6d252ed379d60bcef915caf38a5ec7a5af (diff)
downloaddexon-0x-contracts-880cd6e440c76d819cdb04d2971375cf9e0ea97b.tar.gz
dexon-0x-contracts-880cd6e440c76d819cdb04d2971375cf9e0ea97b.tar.zst
dexon-0x-contracts-880cd6e440c76d819cdb04d2971375cf9e0ea97b.zip
fix: document return value's type, not its name
Diffstat (limited to 'packages/sol-doc')
-rw-r--r--packages/sol-doc/src/solidity_doc_generator.ts4
-rw-r--r--packages/sol-doc/test/solidity_doc_generator_test.ts8
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts
index 074fb1f37..b2b5daff3 100644
--- a/packages/sol-doc/src/solidity_doc_generator.ts
+++ b/packages/sol-doc/src/solidity_doc_generator.ts
@@ -291,11 +291,11 @@ function _genMethodReturnTypeDoc(
methodReturnTypeDoc.typeDocType = TypeDocTypes.Tuple;
methodReturnTypeDoc.tupleElements = [];
for (const output of outputs) {
- methodReturnTypeDoc.tupleElements.push({ name: output.name, typeDocType: TypeDocTypes.Intrinsic });
+ methodReturnTypeDoc.tupleElements.push({ name: output.type, typeDocType: TypeDocTypes.Intrinsic });
}
} else if (outputs.length === 1) {
methodReturnTypeDoc.typeDocType = TypeDocTypes.Intrinsic;
- methodReturnTypeDoc.name = outputs[0].name;
+ methodReturnTypeDoc.name = outputs[0].type;
}
return methodReturnTypeDoc;
}
diff --git a/packages/sol-doc/test/solidity_doc_generator_test.ts b/packages/sol-doc/test/solidity_doc_generator_test.ts
index 0cbb786af..c780d3d31 100644
--- a/packages/sol-doc/test/solidity_doc_generator_test.ts
+++ b/packages/sol-doc/test/solidity_doc_generator_test.ts
@@ -86,8 +86,8 @@ describe('#SolidityDocGenerator', () => {
it('parameter comment', () => {
expect(methodDoc.parameters[0].comment).to.equal('publicMethod @param');
});
- it('return type name', () => {
- expect(methodDoc.returnType.name).to.equal('r');
+ it('return type', () => {
+ expect(methodDoc.returnType.name).to.equal('int256');
});
it('return comment', () => {
expect(methodDoc.returnComment).to.equal('publicMethod @return');
@@ -116,8 +116,8 @@ describe('#SolidityDocGenerator', () => {
it('parameter comment', () => {
expect(methodDoc.parameters[0].comment).to.equal('externalMethod @param');
});
- it('return type name', () => {
- expect(methodDoc.returnType.name).to.equal('r');
+ it('return type', () => {
+ expect(methodDoc.returnType.name).to.equal('int256');
});
it('return comment', () => {
expect(methodDoc.returnComment).to.equal('externalMethod @return');
lass='deletions'>-10/+23 * Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-311-0/+1 * - Update to 0.3.2miwi2010-05-025-11/+38 * - update to 1.4.1dinoex2010-03-281-1/+1 * - update to jpeg-8dinoex2010-02-051-0/+1 * - Set USE_LDCONFIG (reported by portlint)amdmi32010-02-041-0/+4 * - Update to 0.3.1wen2010-01-173-31/+28 * Reset maintainer at his request.linimon2009-12-161-1/+1 * Reinstate maintainer at his request.linimon2009-12-041-1/+1 * Temporarily reassign ports maintained by chris@officialunix.com back tolinimon2009-11-261-1/+1 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-311-0/+1