diff options
| author | Stephen Blott | 2015-01-11 07:15:06 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-01-11 07:15:06 +0000 | 
| commit | d65075a3b66fae93a10b849162fa907d0eb99846 (patch) | |
| tree | 721de43d14028cea46b53b792eaf907912c044c8 /lib/handler_stack.coffee | |
| parent | 06a2ea5ccdef3703df23fe4233921bd2a6af3abf (diff) | |
| download | vimium-d65075a3b66fae93a10b849162fa907d0eb99846.tar.bz2 | |
Modes; add DOM tests.
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() | 
