diff options
| author | Stephen Blott | 2016-03-26 11:57:41 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-26 11:57:45 +0000 |
| commit | b3f9dc520a8f7245db44f843b3994d5e32b19eeb (patch) | |
| tree | d94ce13fbe728cb3b9fafbab3ca3168af755826e /lib | |
| parent | c40f6fa3da204144b6a1a0fca5f7849a9ce5fe3e (diff) | |
| download | vimium-b3f9dc520a8f7245db44f843b3994d5e32b19eeb.tar.bz2 | |
Simplify invokeCommandString().
There's no need to have the previous unusual calling style (passing the
arguments as a list. It looks more natural to pass tham just as regular
arguments, as here.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.coffee | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee index 31f4bec6..7fb6144b 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -11,13 +11,13 @@ Utils = # Takes a dot-notation object string and call the function # that it points to with the correct value for 'this'. - invokeCommandString: (str, argArray) -> + invokeCommandString: (str, args...) -> components = str.split('.') obj = window for component in components[0...-1] obj = obj[component] func = obj[components.pop()] - func.apply(obj, argArray) + func.apply(obj, args) # Escape all special characters, so RegExp will parse the string 'as is'. # Taken from http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex |
