diff --git a/event.js b/event.js index 7c6ef90..47444ed 100644 --- a/event.js +++ b/event.js @@ -169,9 +169,11 @@ function(name, func, options={}){ return h !== func && h.__event_original_handler__ !== func })) return this }, + // remove the handle from the arguments... toString: function(){ - return func.toString() - .replace(/^(function[^(]*\()[^,)]*, ?/, '$1') }, + return 'Eventfull ' + +(func.toString() + .replace(/^(function[^(]*\()[^,)]*, ?/, '$1')) }, }) Object.defineProperty(method, 'name', { @@ -247,9 +249,10 @@ function(name, func, options={}){ // still need to base the doc on the user's func... toString: function(){ return func ? - func.toString() - .replace(/^(function[^(]*\()[^,)]*, ?/, '$1') - : `function ${name}(){}`}, + 'Event ' + +func.toString() + .replace(/^(function[^(]*\()[^,)]*, ?/, '$1') + : `Event function ${name}(){}`}, }) } @@ -258,9 +261,14 @@ function(name, func, options={}){ var PureEvent = module.PureEvent = function(name, options={}){ - return Event(name, function(handle, trigger){ - trigger === module.TRIGGER - || handle(false) }, options)} + return object.mixin( + Event(name, function(handle, trigger){ + trigger === module.TRIGGER + || handle(false) }, options), + { + toString: function(){ + return `PureEvent ${name}(){}`}, + }) } diff --git a/package.json b/package.json index 1b47cec..d901df8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "5.0.10", + "version": "5.0.11", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": {