Fix for Rhino usage warning
Warning was RHINO USAGE WARNING: Missed Context.javaToJS() conversion from threadTimeoutPool[threadId].interrupt() I'm assuming this came about from the switch to Rhino 1.7something, but I'm not positive.
This commit is contained in:
parent
2be0c284e0
commit
7b8d034d48
|
@ -140,7 +140,7 @@
|
||||||
* also sets clearTimeout & clearInterval on same level.
|
* also sets clearTimeout & clearInterval on same level.
|
||||||
*/
|
*/
|
||||||
(function() {
|
(function() {
|
||||||
var threadTimeoutPool = {};
|
var threadTimeoutPool = new java.util.HashMap();
|
||||||
|
|
||||||
window.setTimeout = function(closure, timeout) {
|
window.setTimeout = function(closure, timeout) {
|
||||||
var thread = spawn(function() {
|
var thread = spawn(function() {
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
threadTimeoutPool[thread.getId()] = thread;
|
threadTimeoutPool.put(thread.getId(), thread);
|
||||||
return thread.getId();
|
return thread.getId();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -174,15 +174,14 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
threadTimeoutPool[thread.getId()] = thread;
|
threadTimeoutPool.put(thread.getId(), thread);
|
||||||
return thread.getId();
|
return thread.getId();
|
||||||
};
|
};
|
||||||
|
|
||||||
window.clearTimeout = function(threadId) {
|
window.clearTimeout = function(threadId) {
|
||||||
if (threadId) {
|
if (threadId) {
|
||||||
if(threadTimeoutPool[threadId]) {
|
if(threadTimeoutPool.containsKey(threadId)) {
|
||||||
threadTimeoutPool[threadId].interrupt();
|
threadTimeoutPool.remove(threadId).interrupt();
|
||||||
delete threadTimeoutPool[threadId];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue