forked from cory/tildefriends
Cleanup this state, maybe.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3910 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
782b5593d5
commit
af3e96c7e8
@ -48,12 +48,14 @@ function call_rpc(message) {
|
|||||||
} else if (message.result !== undefined) {
|
} else if (message.result !== undefined) {
|
||||||
if (g_calls[message.id]) {
|
if (g_calls[message.id]) {
|
||||||
g_calls[message.id].resolve(message.result);
|
g_calls[message.id].resolve(message.result);
|
||||||
|
delete g_calls[message.id];
|
||||||
} else {
|
} else {
|
||||||
throw new Error(message.id + ' not found to reply.');
|
throw new Error(message.id + ' not found to reply.');
|
||||||
}
|
}
|
||||||
} else if (message.error !== undefined) {
|
} else if (message.error !== undefined) {
|
||||||
if (g_calls[message.id]) {
|
if (g_calls[message.id]) {
|
||||||
g_calls[message.id].reject(message.error);
|
g_calls[message.id].reject(message.error);
|
||||||
|
delete g_calls[message.id];
|
||||||
} else {
|
} else {
|
||||||
throw new Error(message.id + ' not found to reply.');
|
throw new Error(message.id + ' not found to reply.');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user