[Pkg-javascript-commits] [dojo] 21/87: Only execute after aspects that were added before the current dispatch execution began, applied to 1.7, refs #13743 !strict

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.7.5
in repository dojo.

commit 181285f368d8e2996a982811036ca5ccdae78ad7
Author: Kris Zyp <kriszyp at gmail.com>
Date:   Tue Feb 7 14:32:09 2012 +0000

    Only execute after aspects that were added before the current dispatch execution began, applied to 1.7, refs #13743 !strict
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.7/dojo@27770 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 aspect.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/aspect.js b/aspect.js
index 2d98e8e..38be8bd 100644
--- a/aspect.js
+++ b/aspect.js
@@ -95,6 +95,7 @@ define([], function(){
 =====*/
 
 	"use strict";
+	var nextId = 0;
 	function advise(dispatcher, type, advice, receiveArguments){
 		var previous = dispatcher[type];
 		var around = type == "around";
@@ -132,6 +133,7 @@ define([], function(){
 						}
 					}
 				},
+				id: nextId++,
 				advice: advice,
 				receiveArguments: receiveArguments
 			};
@@ -164,6 +166,7 @@ define([], function(){
 			if(!existing || existing.target != target){
 				// no dispatcher in place
 				target[methodName] = dispatcher = function(){
+					var executionId = nextId;
 					// before advice
 					var args = arguments;
 					var before = dispatcher.before;
@@ -177,7 +180,7 @@ define([], function(){
 					}
 					// after advice
 					var after = dispatcher.after;
-					while(after){
+					while(after && after.id < executionId){
 						results = after.receiveArguments ? after.advice.apply(this, args) || results :
 								after.advice.call(this, results);
 						after = after.next;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list