From 66c1a6bae91546b4e79b25b50e8e30612ecc98e5 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Sun, 10 May 2020 18:42:26 +0200 Subject: [PATCH] fix linting errors #34 --- dist/lips.js | 28 +++++++++------------------- src/lips.js | 20 ++++++++------------ 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/dist/lips.js b/dist/lips.js index 2a10157d..70ad85ba 100644 --- a/dist/lips.js +++ b/dist/lips.js @@ -24,7 +24,7 @@ * Copyright (c) 2014-present, Facebook, Inc. * released under MIT license * - * build: Sun, 10 May 2020 16:36:01 +0000 + * build: Sun, 10 May 2020 16:42:14 +0000 */ (function () { 'use strict'; @@ -4831,7 +4831,7 @@ LComplex.prototype._op = function (op, n) { var fn = LComplex._op[op]; - return this[fn].call(this, n); + return this[fn](n); }; // ------------------------------------------------------------------------- @@ -5296,11 +5296,6 @@ LNumber.isComplex = function (n) { var ret = n instanceof LComplex || LNumber.isNumber(n.im) && LNumber.isNumber(n.re); - - if (LNumber.isNumber(n.im) && n.re === undefined$1) { - debugger; - } - return ret; }; // ------------------------------------------------------------------------- @@ -5610,11 +5605,6 @@ LNumber.prototype.pow = function (n) { - var _this$coerce5 = this.coerce(n), - _this$coerce6 = slicedToArray(_this$coerce5, 2), - a = _this$coerce6[0], - b = _this$coerce6[1]; - if (LNumber.isNative(this.value)) { try { var pow = new Function('a,b', 'return a**b;'); @@ -5666,10 +5656,10 @@ LNumber.prototype.cmp = function (n) { - var _this$coerce7 = this.coerce(n), - _this$coerce8 = slicedToArray(_this$coerce7, 2), - a = _this$coerce8[0], - b = _this$coerce8[1]; + var _this$coerce5 = this.coerce(n), + _this$coerce6 = slicedToArray(_this$coerce5, 2), + a = _this$coerce6[0], + b = _this$coerce6[1]; function cmp(a, b) { if (a.value < b.value) { @@ -8979,10 +8969,10 @@ var banner = function () { // Rollup tree-shaking is removing the variable if it's normal string because - // obviously 'Sun, 10 May 2020 16:36:01 +0000' == '{{' + 'DATE}}'; can be removed + // obviously 'Sun, 10 May 2020 16:42:14 +0000' == '{{' + 'DATE}}'; can be removed // but disablig Tree-shaking is adding lot of not used code so we use this // hack instead - var date = LString('Sun, 10 May 2020 16:36:01 +0000').valueOf(); + var date = LString('Sun, 10 May 2020 16:42:14 +0000').valueOf(); var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date); @@ -9015,7 +9005,7 @@ var lips = { version: 'DEV', banner: banner, - date: 'Sun, 10 May 2020 16:36:01 +0000', + date: 'Sun, 10 May 2020 16:42:14 +0000', exec: exec, parse: parse, tokenize: tokenize, diff --git a/src/lips.js b/src/lips.js index 5bdfc9ea..e16af427 100644 --- a/src/lips.js +++ b/src/lips.js @@ -3042,7 +3042,7 @@ // ------------------------------------------------------------------------- LComplex.prototype._op = function(op, n) { const fn = LComplex._op[op]; - return this[fn].call(this, n); + return this[fn](n); }; // ------------------------------------------------------------------------- LComplex.prototype.cmp = function(n) { @@ -3390,9 +3390,6 @@ LNumber.isComplex = function(n) { var ret = n instanceof LComplex || (LNumber.isNumber(n.im) && LNumber.isNumber(n.re)); - if (LNumber.isNumber(n.im) && n.re === undefined) { - debugger; - } return ret; }; // ------------------------------------------------------------------------- @@ -3455,19 +3452,19 @@ }; // ------------------------------------------------------------------------- var matrix = (function() { - var i = (a,b) => [a,b]; + var i = (a, b) => [a, b]; return { bigint: { 'bigint': i, 'float': (a, b) => [LFloat(a.valueOf()), b], - 'rational': (a, b) => [{num: a, denom: 1}, b], - 'complex': (a, b) => [{im: 0, re: a}, b] + 'rational': (a, b) => [{ num: a, denom: 1 }, b], + 'complex': (a, b) => [{ im: 0, re: a }, b] }, float: { - 'bigint': (a,b) => [a, LFloat(b.valueOf())], + 'bigint': (a, b) => [a, LFloat(b.valueOf())], 'float': i, - 'rational': (a,b) => [a, LFloat(b.valueOf())], - 'complex': (a,b) => [{re: a, im: LFloat(0, true)}, b] + 'rational': (a, b) => [a, LFloat(b.valueOf())], + 'complex': (a, b) => [{ re: a, im: LFloat(0, true) }, b] }, complex: { bigint: complex('bigint'), @@ -3476,7 +3473,7 @@ complex: i }, rational: { - bigint: (a, b) => [a, {num: b, denom: 1}], + bigint: (a, b) => [a, { num: b, denom: 1 }], float: (a, b) => [LFloat(a.valueOf()), b], rational: i, complex: complex('rational') @@ -3631,7 +3628,6 @@ }; // ------------------------------------------------------------------------- LNumber.prototype.pow = function(n) { - const [a, b] = this.coerce(n); if (LNumber.isNative(this.value)) { try { var pow = new Function('a,b', 'return a**b;');