From 64d3de1fd2e9bdcc94e9405dbcfc25ef720b0e76 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 30 Apr 2020 02:20:29 +0300 Subject: [PATCH] updated docs... Signed-off-by: Alex A. Naanou --- README.md | 10 ++++++++++ object.js | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dc952f..fa66e8e 100755 --- a/README.md +++ b/README.md @@ -212,9 +212,19 @@ parent(, ) -> undefined ``` +_Edge case: The `parent(, ..)` 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(, , ) + -> + -> undefined + parentCall(, ) -> -> undefined diff --git a/object.js b/object.js index 5f3273c..ce6a2a6 100755 --- a/object.js +++ b/object.js @@ -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: