diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 30d3706ce..b07410073 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -1,6 +1,6 @@ var mapping = require('./_mapping'), mutateMap = mapping.mutate, - placeholder = {}; + fallbackHolder = {}; /** * The base implementation of `convert` which accepts a `util` object of methods @@ -40,7 +40,8 @@ function baseConvert(util, name, func, options) { 'rearg': 'rearg' in options ? options.rearg : true }; - var forceRearg = ('rearg' in options) && options.rearg; + var forceRearg = ('rearg' in options) && options.rearg, + placeholder = isLib ? func : fallbackHolder; var helpers = isLib ? func : { 'ary': util.ary, diff --git a/test/test-fp.js b/test/test-fp.js index e47edd107..c69d9486d 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -715,7 +715,20 @@ QUnit.module('placeholder methods'); (function() { - QUnit.test('should support placeholders', function(assert) { + QUnit.test('should use `fp` as the default placeholder', function(assert) { + assert.expect(3); + + var actual = fp.add(fp, 'b')('a'); + assert.strictEqual(actual, 'ab'); + + actual = fp.slice(fp, 2)(1)(['a', 'b', 'c']); + assert.deepEqual(actual, ['b']); + + actual = fp.fill(fp, 2)(1, '*')([1, 2, 3]); + assert.deepEqual(actual, [1, '*', 3]); + }); + + QUnit.test('should support `fp.placeholder`', function(assert) { assert.expect(6); _.each([[], fp.__], function(ph) {