diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index b1ca29c6a15..372855619d6 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -85,6 +85,13 @@ describe('ipc module', function () { assert.equal(foo.baz(), 123) }) + it('includes the length of functions specified as arguments', function () { + var a = remote.require(path.join(fixtures, 'module', 'function-with-args.js')) + assert.equal(a(function (a, b, c, d, f) {}), 5) + assert.equal(a((a) => {}), 1) + assert.equal(a((...args) => {}), 0) + }) + it('handles circular references in arrays and objects', function () { var a = remote.require(path.join(fixtures, 'module', 'circular.js')) diff --git a/spec/fixtures/module/function-with-args.js b/spec/fixtures/module/function-with-args.js new file mode 100644 index 00000000000..ed636e5988a --- /dev/null +++ b/spec/fixtures/module/function-with-args.js @@ -0,0 +1,3 @@ +module.exports = function (cb) { + return cb.length +}