cast 메소드에 있던 too many recursion 버그 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6868 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2009-10-15 09:45:48 +00:00
parent d3111892d8
commit 044af4db04

View file

@ -95,7 +95,7 @@ _xe_base = {
* @brief overrides broadcast method
*/
broadcast : function(oSender, msg, params) {
for(var i=0; i < this._apps.length; i++) {
for(var i=0; i < _apps.length; i++) {
this._apps[i].cast(oSender, msg, params);
}
@ -210,10 +210,12 @@ _app_base = {
this._fn_level++;
// BEFORE hooker
var bContinue = this.cast(sender, 'BEFORE_'+msg, params);
if (!bContinue) {
this._fn_level--;
return;
if (typeof aMsg['BEFORE_'+msg] != 'undefined') {
var bContinue = this.cast(sender, 'BEFORE_'+msg, params);
if (!bContinue) {
this._fn_level--;
return;
}
}
// main api function
@ -228,12 +230,14 @@ _app_base = {
}
// AFTER hooker
this.cast(sender, 'AFTER_'+msg, params);
if (typeof aMsg['AFTER_'+msg] != 'undefined') {
this.cast(sender, 'AFTER_'+msg, params);
}
// decrease function level
this._fn_level--;
if (_fn_level < 0) { // top level function
if (this._fn_level < 0) { // top level function
return vRet;
} else {
if (typeof vRet == 'undefined') vRet = true;