From d65075a3b66fae93a10b849162fa907d0eb99846 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 11 Jan 2015 07:15:06 +0000 Subject: Modes; add DOM tests. --- lib/handler_stack.coffee | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/handler_stack.coffee') 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() -- cgit v1.2.3