diff options
author | daurnimator <quae@daurnimator.com> | 2017-12-10 02:08:53 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-12-10 02:36:36 +1100 |
commit | 562ad6f874564c3770d096711f443b49f59ef686 (patch) | |
tree | 910d919dcee89c71eaeeec8465152add19dc4e9f /src/lbaselib.js | |
parent | 54c4a6a66778466630cca7a9223c760942c7ab70 (diff) | |
download | fengari-562ad6f874564c3770d096711f443b49f59ef686.tar.gz fengari-562ad6f874564c3770d096711f443b49f59ef686.tar.bz2 fengari-562ad6f874564c3770d096711f443b49f59ef686.zip |
src/: Fix some linter complaints
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r-- | src/lbaselib.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js index 874a868..54e73b1 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -99,9 +99,11 @@ const luaB_rawset = function(L) { return 1; }; -const opts = ["stop", "restart", "collect", -"count", "step", "setpause", "setstepmul", -"isrunning"].map((e) => lua.to_luastring(e)); +const opts = [ + "stop", "restart", "collect", + "count", "step", "setpause", "setstepmul", + "isrunning" +].map((e) => lua.to_luastring(e)); const luaB_collectgarbage = function(L) { lauxlib.luaL_checkoption(L, 1, lua.to_luastring("collect"), opts); lauxlib.luaL_optinteger(L, 2, 0); @@ -174,14 +176,15 @@ const b_str2int = function(s, base) { } catch (e) { return null; } - let r = /^[\t\v\f \n\r]*([\+\-]?)0*([0-9A-Za-z]+)[\t\v\f \n\r]*$/.exec(s); + let r = /^[\t\v\f \n\r]*([+-]?)0*([0-9A-Za-z]+)[\t\v\f \n\r]*$/.exec(s); if (!r) return null; let neg = r[1] === "-"; let digits = r[2]; let n = 0; for (let si=0; si<digits.length; si++) { - let digit = /\d/.test(digits[si]) ? (digits.charCodeAt(si) - '0'.charCodeAt(0)) - : (digits[si].toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0) + 10); + let digit = /\d/.test(digits[si]) + ? (digits.charCodeAt(si) - '0'.charCodeAt(0)) + : (digits[si].toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0) + 10); if (digit >= base) return null; /* invalid numeral */ n = ((n * base)|0) + digit; } |