Skip to content

Commit

Permalink
A few small cleanups for Event
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Jul 25, 2011
1 parent 0dce89e commit ff096c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
19 changes: 7 additions & 12 deletions src/event/Manager.winxed
Expand Up @@ -57,14 +57,11 @@ namespace Rosella { namespace Event
if (!has_queue)
queue_name = DEFAULT_QUEUE;

if (!isa_type(class Rosella.Event, event)) {
using Rosella.Error.invalid;
invalid(__FUNCTION__, "not a valid event");
}
if (exists self.events[event_name]) {
using Rosella.Error.invalid;
invalid(__FUNCTION__, "Cannot register a new method named " + event_name);
} else
if (!isa_type(class Rosella.Event, event))
Rosella.Error.invalid(__FUNCTION__, "not a valid event");
if (exists self.events[event_name])
Rosella.Error.invalid(__FUNCTION__, "Cannot register a new method named " + event_name);
else
self.events[event_name] = event;
}

Expand Down Expand Up @@ -113,10 +110,8 @@ namespace Rosella { namespace Event
string queue_name [optional], int has_queue [opt_flag])
{
using Rosella.isa_type;
if (!isa_type(class Rosella.Action, action)) {
using Rosella.Error.invalid;
invalid("not a valid action");
}
if (!isa_type(class Rosella.Action, action))
Rosella.Error.invalid("not a valid action");
if (!has_queue)
queue_name = DEFAULT_QUEUE;
var event = self.__get_event_autocreate(event_name);
Expand Down
3 changes: 1 addition & 2 deletions src/event/Queue.winxed
Expand Up @@ -85,8 +85,7 @@ namespace Rosella { namespace Event
{
var action = new Rosella.Action.Sub(
function(var e) {
using Rosella.invoke_method;
invoke_method(object, meth, [e], {});
Rosella.invoke_method(object, meth, [e], {});
}
);
return self.add_subscriber_action(event_name, id, action);
Expand Down

0 comments on commit ff096c5

Please sign in to comment.