提交 a13eb7e5 编写于 作者: P pissang

test(visual): fix clearInterval mock error

上级 2e7feb59
......@@ -86,7 +86,7 @@ window.setTimeout = function (cb, timeout) {
window.clearTimeout = function (id) {
const idx = timeoutHandlers.findIndex(handler => {
handler.id === id
return handler.id === id
});
if (idx >= 0) {
timeoutHandlers.splice(idx, 1);
......@@ -120,14 +120,14 @@ window.setInterval = function (cb, interval) {
id: intervalId,
intervalFrame,
frame: frameIdx + intervalFrame
})
});
return intervalId++;
}
window.clearInterval = function () {
window.clearInterval = function (id) {
const idx = intervalHandlers.findIndex(handler => {
handler.id === id
return handler.id === id;
});
if (idx >= 0) {
intervalHandlers.splice(idx, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册