Skip to content

Commit

Permalink
robustify bind:currentTime - fixes #3524
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Sep 7, 2019
1 parent 41f5961 commit 63ae771
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/compile/render_dom/wrappers/Element/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,10 @@ export default class ElementWrapper extends Wrapper {
function ${handler}() {
${animation_frame && deindent`
@_cancelAnimationFrame(${animation_frame});
if (!${this.var}.paused) ${animation_frame} = @raf(${handler});`}
${needs_lock && `${lock} = true;`}
if (!${this.var}.paused) {
${animation_frame} = @raf(${handler});`}
${needs_lock && `${lock} = true;`}
}
ctx.${handler}.call(${this.var}${contextual_dependencies.size > 0 ? ', ctx' : ''});
}
`);
Expand Down

0 comments on commit 63ae771

Please sign in to comment.