mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
[doclint] parse getters as properties
From the api standpoint, there's no difference between property and a getter. References #14.
This commit is contained in:
parent
45c20c7dad
commit
67d109862a
@ -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()
|
||||
|
@ -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.
|
||||
|
@ -4,4 +4,7 @@ class Foo {
|
||||
|
||||
stop() {
|
||||
}
|
||||
|
||||
get zzz() {
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
[MarkDown] Non-existing method found: Foo.proceed()
|
||||
[MarkDown] Method not found: Foo.stop()
|
||||
[MarkDown] Method not found: Foo.stop()
|
||||
[MarkDown] Property not found: Foo.zzz
|
Loading…
Reference in New Issue
Block a user