diff --git a/docs/api.md b/docs/api.md index 8d9cbc7e035..2c97788d8d1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -86,7 +86,7 @@ * [headers.values()](#headersvalues) - [class: Body](#class-body) * [body.arrayBuffer()](#bodyarraybuffer) - * [body.bodyUsed()](#bodybodyused) + * [body.bodyUsed](#bodybodyused) * [body.buffer()](#bodybuffer) * [body.json()](#bodyjson) * [body.text()](#bodytext) @@ -449,7 +449,7 @@ If there's already a header with name `name`, the header gets overwritten. ### class: Body #### body.arrayBuffer() -#### body.bodyUsed() +#### body.bodyUsed #### body.buffer() #### body.json() #### body.text() diff --git a/utils/doclint/JSBuilder.js b/utils/doclint/JSBuilder.js index 268661712b8..c30ecfb99a1 100644 --- a/utils/doclint/JSBuilder.js +++ b/utils/doclint/JSBuilder.js @@ -30,10 +30,15 @@ class JSOutline { _onMethodDefinition(node) { console.assert(this._currentClassName !== null); console.assert(node.value.type === 'FunctionExpression'); + let methodName = this._extractText(node.key); + if (node.kind === 'get') { + let property = Documentation.Member.createProperty(methodName); + this._currentClassMembers.push(property); + return; + } const args = []; for (let param of node.value.params) args.push(new Documentation.Argument(this._extractText(param))); - let methodName = this._extractText(node.key); let method = Documentation.Member.createMethod(methodName, args); this._currentClassMembers.push(method); // Extract properties from constructor. diff --git a/utils/doclint/test/02-method-errors/foo.js b/utils/doclint/test/02-method-errors/foo.js index fe8b20391fa..3f499572431 100644 --- a/utils/doclint/test/02-method-errors/foo.js +++ b/utils/doclint/test/02-method-errors/foo.js @@ -4,4 +4,7 @@ class Foo { stop() { } + + get zzz() { + } } diff --git a/utils/doclint/test/golden/02-method-errors.txt b/utils/doclint/test/golden/02-method-errors.txt index 6295473cf17..d919f52e99c 100644 --- a/utils/doclint/test/golden/02-method-errors.txt +++ b/utils/doclint/test/golden/02-method-errors.txt @@ -1,2 +1,3 @@ [MarkDown] Non-existing method found: Foo.proceed() -[MarkDown] Method not found: Foo.stop() \ No newline at end of file +[MarkDown] Method not found: Foo.stop() +[MarkDown] Property not found: Foo.zzz \ No newline at end of file