updated docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-04-30 02:20:29 +03:00
parent aea2355520
commit 64d3de1fd2
2 changed files with 13 additions and 1 deletions

View File

@ -212,9 +212,19 @@ parent(<method>, <this>)
-> undefined
```
_Edge case: The `parent(<method>, ..)` has one flaw -- it can't distinguish
between two references to the same method in a chain and will always
return the first, so the first case is preferable. This issue can't be
resolved as this case has no information on the prototype containing the
reference, but these cases should not be very common._
Get parent method and call it
```
parentCall(<prototype>, <name>, <this>)
-> <result>
-> undefined
parentCall(<method>, <this>)
-> <result>
-> undefined

View File

@ -149,6 +149,7 @@ function(proto, name){
function(obj){ return 'stop' })
.pop()
return res ?
// get next value...
res.__proto__[name]
: undefined }
@ -162,7 +163,8 @@ function(proto, name){
//
//
// This also gracefully handles the case when no higher level definition
// is found, i.e. the corresponding parent(..) call will return undefined.
// is found, i.e. the corresponding parent(..) call will return undefined
// or a non-callable.
//
// NOTE: this is just like parent(..) but will call the retrieved method,
// essentially this is a shorthand to: