From 12b37db70edf83849dcf88b4e50e987234561695 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 6 Jan 2018 18:22:44 +1100 Subject: src/defs.js: Avoid for..of, as generated code uses Symbol.iterator, which might not be available in older environments --- src/defs.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/defs.js b/src/defs.js index 1613bac..bb98485 100644 --- a/src/defs.js +++ b/src/defs.js @@ -190,10 +190,11 @@ const to_jsstring = function(value, from, to) { return str; }; -const uri_allowed = {}; /* bytes allowed unescaped in a uri */ -for (let c of ";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,-_.!~*'()#") { +/* bytes allowed unescaped in a uri */ +const uri_allowed = (";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,-_.!~*'()#").split('').reduce(function(uri_allowed, c) { uri_allowed[c.charCodeAt(0)] = true; -} + return uri_allowed; +}, {}); /* utility function to convert a lua string to a js string with uri escaping */ const to_uristring = function(a) { -- cgit v1.2.3-70-g09d2