diff --git a/actions.js b/actions.js index c271f2b..4342cb6 100755 --- a/actions.js +++ b/actions.js @@ -394,9 +394,9 @@ module.UNDEFINED = ASIS(undefined) // XXX is this correct?? // NOTE: by default an action will return 'this', i.e. the action set // object the action was called from. -// NOTE: if func.nmae is set to '' it will be reset to the -// action name by Action(..). This is a means for extending functions -// to get the specific action name. +// NOTE: if func.nmae is set to '' or it is '' (anonymous +// function) it will be reset to the action name by Action(..). This +// is a means for extending functions to get the specific action name. // Example: // var getActionName = function(func){ // var f = function(...args){ @@ -786,10 +786,8 @@ object.Constructor('Action', Function, { meth.func = func - if(func.name == ''){ - Object.defineProperty(func, 'name', { - value: name, - }) } + ;(func.name == '' || func.name == '') + && Object.defineProperty(func, 'name', { value: name }) // make introspection be a bit better... meth.toString = function(){ diff --git a/package.json b/package.json index 77722f8..5070648 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-actions", - "version": "3.24.20", + "version": "3.24.21", "description": "", "main": "actions.js", "scripts": {