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)
|
* [headers.values()](#headersvalues)
|
||||||
- [class: Body](#class-body)
|
- [class: Body](#class-body)
|
||||||
* [body.arrayBuffer()](#bodyarraybuffer)
|
* [body.arrayBuffer()](#bodyarraybuffer)
|
||||||
* [body.bodyUsed()](#bodybodyused)
|
* [body.bodyUsed](#bodybodyused)
|
||||||
* [body.buffer()](#bodybuffer)
|
* [body.buffer()](#bodybuffer)
|
||||||
* [body.json()](#bodyjson)
|
* [body.json()](#bodyjson)
|
||||||
* [body.text()](#bodytext)
|
* [body.text()](#bodytext)
|
||||||
@ -449,7 +449,7 @@ If there's already a header with name `name`, the header gets overwritten.
|
|||||||
|
|
||||||
### class: Body
|
### class: Body
|
||||||
#### body.arrayBuffer()
|
#### body.arrayBuffer()
|
||||||
#### body.bodyUsed()
|
#### body.bodyUsed
|
||||||
#### body.buffer()
|
#### body.buffer()
|
||||||
#### body.json()
|
#### body.json()
|
||||||
#### body.text()
|
#### body.text()
|
||||||
|
@ -30,10 +30,15 @@ class JSOutline {
|
|||||||
_onMethodDefinition(node) {
|
_onMethodDefinition(node) {
|
||||||
console.assert(this._currentClassName !== null);
|
console.assert(this._currentClassName !== null);
|
||||||
console.assert(node.value.type === 'FunctionExpression');
|
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 = [];
|
const args = [];
|
||||||
for (let param of node.value.params)
|
for (let param of node.value.params)
|
||||||
args.push(new Documentation.Argument(this._extractText(param)));
|
args.push(new Documentation.Argument(this._extractText(param)));
|
||||||
let methodName = this._extractText(node.key);
|
|
||||||
let method = Documentation.Member.createMethod(methodName, args);
|
let method = Documentation.Member.createMethod(methodName, args);
|
||||||
this._currentClassMembers.push(method);
|
this._currentClassMembers.push(method);
|
||||||
// Extract properties from constructor.
|
// Extract properties from constructor.
|
||||||
|
@ -4,4 +4,7 @@ class Foo {
|
|||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get zzz() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
[MarkDown] Non-existing method found: Foo.proceed()
|
[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