I ran into this problem trying to run LibreJs w/ jpm

https://lists.gnu.org/archive/html/help-librejs/2016-01/msg00001.html

A simple patch is attached

Cheers,
Will
From d9316fcb3ed6d45d2103591a77c58818a9c66888 Mon Sep 17 00:00:00 2001
From: William Cummings <[email protected]>
Date: Sat, 30 Apr 2016 10:17:42 -0400
Subject: [PATCH] Don't use array comprehensions

"Non-standard. Do not use!
The array comprehensions is non-standard, and it's unlikely to be added
to ECMAScript. For future-facing usages, consider using
Array.prototype.map, Array.prototype.filter, and arrow functions."

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions
---
 lib/script_entries/crypto.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/script_entries/crypto.js b/lib/script_entries/crypto.js
index d8d9c0a..ba73db3 100644
--- a/lib/script_entries/crypto.js
+++ b/lib/script_entries/crypto.js
@@ -41,7 +41,7 @@ CryptoString.prototype.encryptString = function(str) {
     var data = this.converter.convertToByteArray(str, result);
     this.cryptoHash.update(data, data.length);
     var hash = this.cryptoHash.finish(false);
-    return [this.toHexString(hash.charCodeAt(i)) for (i in hash)].join("");
+    return hash.map(i => this.toHexString(hash.charCodeAt(i))).join("");
 };
 
 CryptoString.prototype.toHexString = function(charCode) {
-- 
1.9.1

Reply via email to