From 36d9b07f7617b18706f9523cfee121a0e2cf61b0 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 4 Mar 2016 06:30:09 +0000 Subject: Do not use standalone @. The styles guide says not to use standalone `@`. So this changes the occurrences I could find (with sed) to `this`. Occurrences within files with major outstanding PRs are omitted. --- content_scripts/mode.coffee | 6 +++--- content_scripts/mode_insert.coffee | 2 +- content_scripts/mode_visual_edit.coffee | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 782328ce..454a6ed9 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -117,7 +117,7 @@ class Mode key = Utils.getIdentity @options.singleton @onExit -> delete singletons[key] @deactivateSingleton @options.singleton - singletons[key] = @ + singletons[key] = this # If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys, # and calls @registerStateChange() (if defined) whenever the state changes. The mode also tracks the @@ -164,7 +164,7 @@ class Mode keypress: handler keyup: -> handlerStack.stopBubblingAndFalse - Mode.modes.push @ + Mode.modes.push this @setIndicator() @logModes() # End of Mode constructor. @@ -194,7 +194,7 @@ class Mode @modeIsExiting = true handler args... for handler in @exitHandlers handlerStack.remove handlerId for handlerId in @handlers - Mode.modes = Mode.modes.filter (mode) => mode != @ + Mode.modes = Mode.modes.filter (mode) => mode != this @modeIsActive = false @setIndicator() diff --git a/content_scripts/mode_insert.coffee b/content_scripts/mode_insert.coffee index 9037b05a..f86038d6 100644 --- a/content_scripts/mode_insert.coffee +++ b/content_scripts/mode_insert.coffee @@ -77,7 +77,7 @@ class InsertMode extends Mode shadowRoot.removeEventListener type, listener, true # Only for tests. This gives us a hook to test the status of the permanently-installed instance. - InsertMode.permanentInstance = @ if @permanent + InsertMode.permanentInstance = this if @permanent isActive: (event) -> return false if event == InsertMode.suppressedEvent diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index ae8897ca..cca305f8 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -274,7 +274,7 @@ class Movement extends CountPrefix handleMovementKeyChar: (keyChar, count = 1) -> switch typeof @movements[keyChar] when "string" then @runMovement @movements[keyChar] for [0...count] - when "function" then @movements[keyChar].call @, count + when "function" then @movements[keyChar].call this, count @scrollIntoView() constructor: (options) -> @@ -307,7 +307,7 @@ class Movement extends CountPrefix return @continueBubbling if command == "0" and 0 < @countPrefix.length if @commands[command] - @commands[command].call @, @getCountPrefix() + @commands[command].call this, @getCountPrefix() @scrollIntoView() return @suppressEvent -- cgit v1.2.3