mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Preserve the value of this when applying before advice
This commit is contained in:
@@ -13,8 +13,8 @@ _.mixin
|
||||
adviseBefore: (object, methodName, advice) ->
|
||||
original = object[methodName]
|
||||
object[methodName] = (args...) ->
|
||||
unless advice(args...) == false
|
||||
original(args...)
|
||||
unless advice.apply(this, args) == false
|
||||
original.apply(this, args)
|
||||
|
||||
escapeRegExp: (string) ->
|
||||
# Referring to the table here:
|
||||
|
||||
Reference in New Issue
Block a user