Skip to content

Commit

Permalink
fix linting errors #34
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 10, 2020
1 parent 7a3e5f0 commit 66c1a6b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
28 changes: 9 additions & 19 deletions dist/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}; // -------------------------------------------------------------------------


Expand Down Expand Up @@ -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;
}; // -------------------------------------------------------------------------

Expand Down Expand Up @@ -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;');
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down
20 changes: 8 additions & 12 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
};
// -------------------------------------------------------------------------
Expand Down Expand Up @@ -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'),
Expand All @@ -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')
Expand Down Expand Up @@ -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;');
Expand Down

0 comments on commit 66c1a6b

Please sign in to comment.