| 
					
				 | 
			
			
				@@ -91,15 +91,23 @@ class Worker(): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	    if not is_allowed: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		continue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if next_event._type == "PushState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                self._stack.append(next_event) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                for j in xrange(i+1, num_events): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    next_event = self._events[j] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if next_event._type == "SetState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        break 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            elif next_event._type == "PopState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if not len(self._stack) == 0: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    curr_event = self._stack.pop() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	    if curr_event._type == "SetState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if next_event._type == "PopState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		    sys.exit("ERROR: The trace is most likely corrupted " 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			     "because a PopState event has been found just " 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			     "after a SetState!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	    elif curr_event._type == "PushState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		self._stack.append(curr_event) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		continue # Will look later to find a PopState event. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	    elif curr_event._type == "PopState": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if len(self._stack) == 0: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		    sys.exit("ERROR: The trace is most likely corrupted " 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			     "because a PopState event has been found without " 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			     "a PushState!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		next_event = curr_event 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		curr_event = self._stack.pop() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	    else: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		sys.exit("ERROR: Invalid event type!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             # Compute duration with the next event. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             a = curr_event._start_time 
			 |