now can pass the action itself to introspection function...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-12-10 05:17:10 +03:00
parent 2f8250d75d
commit 78a47e91ac
2 changed files with 27 additions and 7 deletions

View File

@ -1007,6 +1007,9 @@ module.MetaActions = {
// XXX add option to to enable/disable look in .__actioncall__...
getActionAttr: function(action, attr){
var cur = this
action = typeof(action) == 'function' ?
action.name
: action
// go up the proto chain...
while(cur.__proto__ != null){
@ -1042,6 +1045,9 @@ module.MetaActions = {
// base Action object is checked (Action.prototype.await)...
getRootActionAttr: function(action, attr){
var cur = this
action = typeof(action) == 'function' ?
action.name
: action
// go up the proto chain...
while(cur.__proto__ != null){
@ -1074,14 +1080,21 @@ module.MetaActions = {
getDoc: function(actions){
var res = {}
var that = this
actions = actions == null ? this.actions
: arguments.length > 1 ? [...arguments]
: typeof(actions) == typeof('str') ? [actions]
actions = actions == null ?
this.actions
: arguments.length > 1 ?
[...arguments]
: (typeof(actions) == typeof('str')
|| typeof(actions) == 'function') ?
[actions]
: actions
// get the first defined set of docs in the inheritance chain...
actions.forEach(function(n){
var cur = that
n = typeof(n) == 'function' ?
n.name
: n
res[n] = []
// go up the proto chain...
while(cur.__proto__ != null){
@ -1094,14 +1107,21 @@ module.MetaActions = {
getPath: function(actions){
var res = {}
var that = this
actions = actions == null ? this.actions
: arguments.length > 1 ? [...arguments]
: typeof(actions) == typeof('str') ? [actions]
actions = actions == null ?
this.actions
: arguments.length > 1 ?
[...arguments]
: (typeof(actions) == typeof('str')
|| typeof(actions) == 'function') ?
[actions]
: actions
// get the first defined set of docs in the inheritance chain...
actions.forEach(function(n){
var cur = that
n = typeof(n) == 'function' ?
n.name
: n
// go up the proto chain...
while(cur.__proto__ != null){
if(cur[n] != null && cur[n].doc != null){

View File

@ -1,6 +1,6 @@
{
"name": "ig-actions",
"version": "3.24.21",
"version": "3.24.22",
"description": "",
"main": "actions.js",
"scripts": {