diff options
Diffstat (limited to 'lib/handler_stack.coffee')
| -rw-r--r-- | lib/handler_stack.coffee | 13 | 
1 files changed, 8 insertions, 5 deletions
| diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee index 22d04941..c21ba8a8 100644 --- a/lib/handler_stack.coffee +++ b/lib/handler_stack.coffee @@ -98,14 +98,17 @@ class HandlerStack      label ||= if result then "continue/truthy" else "suppress"      @log @eventNumber, type, handler._name, label -  logRecords: []    log: (args...) ->      line = args.join " " -    @logRecords.push line      console.log line -  clipLog: -> -    Clipboard.copy logRecords.join "\n" +  # Used by tests to get a duplicate copy of the initialized handler stack. +  duplicate: -> +    dup = new HandlerStack() +    dup.stack = @stack[..] +    for prop in [ "stopBubblingAndTrue", "stopBubblingAndFalse", "restartBubbling" ] +      dup[prop] = @[prop] +    dup  root.HandlerStack = HandlerStack -root.handlerStack = new HandlerStack +root.handlerStack = new HandlerStack() | 
