Index: openacs-4/packages/ajaxhelper/www/resources/yui/event/event-debug.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/resources/yui/event/event-debug.js,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ajaxhelper/www/resources/yui/event/event-debug.js 8 Sep 2007 14:22:05 -0000 1.3 +++ openacs-4/packages/ajaxhelper/www/resources/yui/event/event-debug.js 9 Apr 2009 23:15:48 -0000 1.4 @@ -1,8 +1,8 @@ /* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. +Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt -version: 2.3.0 +version: 2.7.0 */ /** @@ -11,7 +11,7 @@ * * @param {String} type The type of event, which is passed to the callback * when the event fires - * @param {Object} oScope The context the event will fire from. "this" will + * @param {Object} context The context the event will fire from. "this" will * refer to this object in the callback. Default value: * the window object. The listener can override this. * @param {boolean} silent pass true to prevent the event from writing to @@ -24,7 +24,7 @@ * @class CustomEvent * @constructor */ -YAHOO.util.CustomEvent = function(type, oScope, silent, signature) { +YAHOO.util.CustomEvent = function(type, context, silent, signature) { /** * The type of event, returned to subscribers when the event fires @@ -34,12 +34,12 @@ this.type = type; /** - * The scope the the event will fire from by default. Defaults to the window + * The context the the event will fire from by default. Defaults to the window * obj * @property scope * @type object */ - this.scope = oScope || window; + this.scope = context || window; /** * By default all custom events are logged in the debug build, set silent @@ -100,16 +100,27 @@ * @type YAHOO.util.CustomEvent * @param {Function} fn The function to execute * @param {Object} obj An object to be passed along when the event - * fires + * fires defaults to the custom event * @param {boolean|Object} override If true, the obj passed in becomes - * the execution scope of the listener. + * the execution context of the listener. * if an object, that object becomes the - * the execution scope. + * the execution context. defaults to + * the custom event */ this.subscribeEvent = new YAHOO.util.CustomEvent(onsubscribeType, this, true); } + + + /** + * In order to make it possible to execute the rest of the subscriber + * stack when one thows an exception, the subscribers exceptions are + * caught. The most recent exception is stored in this property + * @property lastError + * @type Error + */ + this.lastError = null; }; /** @@ -140,22 +151,22 @@ * @param {Function} fn The function to execute * @param {Object} obj An object to be passed along when the event * fires - * @param {boolean|Object} override If true, the obj passed in becomes - * the execution scope of the listener. + * @param {boolean|Object} overrideContext If true, the obj passed in becomes + * the execution context of the listener. * if an object, that object becomes the - * the execution scope. + * the execution context. */ - subscribe: function(fn, obj, override) { + subscribe: function(fn, obj, overrideContext) { if (!fn) { throw new Error("Invalid callback for subscriber to '" + this.type + "'"); } if (this.subscribeEvent) { - this.subscribeEvent.fire(fn, obj, override); + this.subscribeEvent.fire(fn, obj, overrideContext); } - this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) ); + this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, overrideContext) ); }, /** @@ -190,7 +201,7 @@ /** * Notifies the subscribers. The callback functions will be executed - * from the scope specified when the event was created, and with the + * from the context specified when the event was created, and with the * following parameters: *