3 * Copyright(c) 2014-2015 Douglas Christopher Wilson
10 * Module dependencies.
14 var EventEmitter = require('events').EventEmitter
21 lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
22 var limit = Error.stackTraceLimit
24 var prep = Error.prepareStackTrace
26 function prepareObjectStackTrace (obj, stack) {
30 Error.prepareStackTrace = prepareObjectStackTrace
31 Error.stackTraceLimit = 2
34 Error.captureStackTrace(obj)
37 var stack = obj.stack.slice()
39 Error.prepareStackTrace = prep
40 Error.stackTraceLimit = limit
42 return stack[0].toString ? toString : require('./callsite-tostring')
45 lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () {
46 return EventEmitter.listenerCount || require('./event-listener-count')
50 * Define a lazy property.
53 function lazyProperty (obj, prop, getter) {
57 Object.defineProperty(obj, prop, {
66 Object.defineProperty(obj, prop, {
74 * Call toString() on the obj
77 function toString (obj) {