Skip to content

Commit

Permalink
fix lint issues (fantasyland#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
safareli authored May 26, 2017
1 parent 65e9e33 commit 09fbb75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions bench/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const ListDef = {
}

const TupleOld = daggyOld.tagged('Tuple', TupleDef)
const ListOld = daggyOld.taggedSum('List', ListDef)
const listOld = ListOld.Cons(1, ListOld.Nil)
const ListOld = daggyOld.taggedSum('List', ListDef)
const listOld = ListOld.Cons(1, ListOld.Nil)
const tupleOld = TupleOld(1, 2)

const TupleNew = daggyNew.tagged('Tuple', TupleDef)
const ListNew = daggyNew.taggedSum('List', ListDef)
const listNew = ListNew.Cons(1, ListNew.Nil)
const ListNew = daggyNew.taggedSum('List', ListDef)
const listNew = ListNew.Cons(1, ListNew.Nil)
const tupleNew = TupleNew(1, 2)

const pattern = {
Expand Down
26 changes: 13 additions & 13 deletions src/daggy.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ const arrToString = (arr) => {
return str + ')'
}

const makeConstructor= (fields, proto) => {
const makeConstructor = (fields, proto) => {
switch (fields.length) {
case 1: return function(a) { return makeValue(fields, proto, [a], arguments.length) }
case 2: return function(a, b) { return makeValue(fields, proto, [a, b], arguments.length) }
case 3: return function(a, b, c) { return makeValue(fields, proto, [a, b, c], arguments.length) }
case 4: return function(a, b, c, d) { return makeValue(fields, proto, [a, b, c, d], arguments.length) }
case 5: return function(a, b, c, d, e) { return makeValue(fields, proto, [a, b, c, d, e], arguments.length) }
case 6: return function(a, b, c, d, e, f) { return makeValue(fields, proto, [a, b, c, d, e, f], arguments.length) }
case 7: return function(a, b, c, d, e, f, g) { return makeValue(fields, proto, [a, b, c, d, e, f, g], arguments.length) }
case 8: return function(a, b, c, d, e, f, g, h) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h], arguments.length) }
case 9: return function(a, b, c, d, e, f, g, h, i) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h, i], arguments.length) }
case 10: return function(a, b, c, d, e, f, g, h, i, j) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h, i, j], arguments.length) }
case 1: return function (a) { return makeValue(fields, proto, [a], arguments.length) }
case 2: return function (a, b) { return makeValue(fields, proto, [a, b], arguments.length) }
case 3: return function (a, b, c) { return makeValue(fields, proto, [a, b, c], arguments.length) }
case 4: return function (a, b, c, d) { return makeValue(fields, proto, [a, b, c, d], arguments.length) }
case 5: return function (a, b, c, d, e) { return makeValue(fields, proto, [a, b, c, d, e], arguments.length) }
case 6: return function (a, b, c, d, e, f) { return makeValue(fields, proto, [a, b, c, d, e, f], arguments.length) }
case 7: return function (a, b, c, d, e, f, g) { return makeValue(fields, proto, [a, b, c, d, e, f, g], arguments.length) }
case 8: return function (a, b, c, d, e, f, g, h) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h], arguments.length) }
case 9: return function (a, b, c, d, e, f, g, h, i) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h, i], arguments.length) }
case 10: return function (a, b, c, d, e, f, g, h, i, j) { return makeValue(fields, proto, [a, b, c, d, e, f, g, h, i, j], arguments.length) }
default: return Object.defineProperty(
function() { return makeValue(fields, proto, arguments, arguments.length) },
"length",
function () { return makeValue(fields, proto, arguments, arguments.length) },
'length',
{ value: fields.length }
)
}
Expand Down

0 comments on commit 09fbb75

Please sign in to comment.