From e8ca6f7a63149ce9125bb5e7660409e2fc4978ef Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 29 Oct 2015 20:15:42 -0400 Subject: asdfghjkl.js: Remove `let` block `let` blocks of the form let (var1 [= value1] [, var2 [= value2]] [, ..., varN [= valueN]]) block; are non-standard, as specified in the following sections of the Mozilla Developer Network page on `let`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Non-standard_let_extensions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#let_blocks Removing the `let` block here for forward compatibility. This change also gets rid of the `self` variable created inside the `let` block, using an arrow function instead to obviate the need to save a `this` reference. --- asdfghjkl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asdfghjkl.js b/asdfghjkl.js index 5364305..d2bfc8f 100644 --- a/asdfghjkl.js +++ b/asdfghjkl.js @@ -98,10 +98,10 @@ let PLUGIN_INFO = xml` function around (obj, name, func) { let next = obj[name]; obj[name] = function () { - let (self = this, args = Array.from(arguments)) - func.call(self, - function () next.apply(self, args), - args); + let args = Array.from(arguments); + func.call(this, + () => next.apply(this, args), + args); } } -- cgit v1.2.3