diff --git a/actions.js b/actions.js index 25af44f..d51ce39 100755 --- a/actions.js +++ b/actions.js @@ -643,15 +643,18 @@ function Alias(alias, target){ return new Alias(alias, target) } + var parsed = typeof(target) == typeof('str') ? null : target + var doc = parsed ? parsed.doc : null + // XXX would be good to pre-parse the target... var meth = Action(alias, // XXX pre-parse the doc if possible... - null, null, + doc, null, { alias: target }, function(){ // parse the target... - var action = this.parseStringAction(target) - + // XXX should we cache here??? + var action = parsed || this.parseStringAction(target) var args = action.arguments.slice() // XXX merge args... @@ -718,6 +721,16 @@ module.MetaActions = { parseStringAction: parseStringAction, + // XXX should this prevent overriding stuff??? + // XXX move to a better spot... + alias: Action('alias', function(alias, target){ + var parsed = typeof(target) == typeof('str') ? + this.parseStringAction(target) + : target + this[alias] = Alias(alias, parsed) + }), + + // Get action attribute... // // NOTE: this will get attribute set both on the action object and @@ -1493,8 +1506,7 @@ module.MetaActions = { // Remove a set of local mixed in actions from object... // mixoutFrom: function(to, options){ - return this.mixout.call(to, this, options) - }, + return this.mixout.call(to, this, options) }, // Create a child object... // diff --git a/package.json b/package.json index 4b5809e..14b6778 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-actions", - "version": "3.3.3", + "version": "3.3.4", "description": "", "main": "actions.js", "scripts": {