tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 11176d7f6a2b47758d8b4acfe9c169522aa6b545
parent 310a2828942440d9ee3456966230b2da1a8d1d10
Author: Nicolas Chevobbe <nchevobbe@mozilla.com>
Date:   Wed, 19 Nov 2025 06:04:21 +0000

Bug 2000793 - [devtools] Fix mozilla/use-isInstance eslint errors in devtools/server/actors/animation.js. r=devtools-reviewers,ochameau

isInstance needed to be mocked in the xpcshell test where we mock the window

Differential Revision: https://phabricator.services.mozilla.com/D272997

Diffstat:
Mdevtools/server/actors/animation.js | 10+++++-----
Mdevtools/server/tests/xpcshell/test_animation_name.js | 4++++
Mdevtools/server/tests/xpcshell/test_animation_type.js | 4++++
3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/devtools/server/actors/animation.js b/devtools/server/actors/animation.js @@ -185,19 +185,19 @@ class AnimationPlayerActor extends Actor { } isCssAnimation(player = this.player) { - return player instanceof this.window.CSSAnimation; + return this.window.CSSAnimation.isInstance(player); } isCssTransition(player = this.player) { - return player instanceof this.window.CSSTransition; + return this.window.CSSTransition.isInstance(player); } isScriptAnimation(player = this.player) { return ( - player instanceof this.window.Animation && + this.window.Animation.isInstance(player) && !( - player instanceof this.window.CSSAnimation || - player instanceof this.window.CSSTransition + this.window.CSSAnimation.isInstance(player) || + this.window.CSSTransition.isInstance(player) ) ); } diff --git a/devtools/server/tests/xpcshell/test_animation_name.js b/devtools/server/tests/xpcshell/test_animation_name.js @@ -21,6 +21,10 @@ function run_test() { constructor() { this.effect = { target: getMockNode() }; } + + static isInstance(instance) { + return instance instanceof this; + } }; window.CSSAnimation = class extends window.Animation {}; diff --git a/devtools/server/tests/xpcshell/test_animation_type.js b/devtools/server/tests/xpcshell/test_animation_type.js @@ -21,6 +21,10 @@ function run_test() { constructor() { this.effect = { target: getMockNode() }; } + + static isInstance(instance) { + return instance instanceof this; + } }; window.CSSAnimation = class extends window.Animation {};