From 6d9efab0dec6119114ceb9c366dc65373d8a0ecd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 29 Oct 2015 20:04:21 -0400 Subject: asdfghjkl.js: Add brackets to multiline function Fix this error: Sourcing file failed: ${HOME}/.vimperator/plugin/asdfghjkl.js:101: SyntaxError: expected expression, got keyword 'let' That was caused by having a multiline expression in a function without braces. (Discovered on Firefox 41.0.2 on Mac OS X 10.8 with Vimperator 3.10.1.) --- asdfghjkl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asdfghjkl.js b/asdfghjkl.js index 7826a48..5364305 100644 --- a/asdfghjkl.js +++ b/asdfghjkl.js @@ -97,11 +97,12 @@ let PLUGIN_INFO = xml` function around (obj, name, func) { let next = obj[name]; - obj[name] = function () + obj[name] = function () { let (self = this, args = Array.from(arguments)) func.call(self, function () next.apply(self, args), args); + } } around(events, 'onKeyPress', function (next, [event]) { -- cgit v1.2.3