diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 102b23ece5..41cc2488d8 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -32,6 +32,12 @@ describe('ipc module', function () { assert.equal(a.id, 1127) }) + it('should work when object has no prototype', function () { + var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js')) + assert.deepEqual(a.foo, {}) + assert.equal(a.bar, 1234) + }) + it('should search module from the user app', function () { comparePaths(path.normalize(remote.process.mainModule.filename), path.resolve(__dirname, 'static', 'main.js')) comparePaths(path.normalize(remote.process.mainModule.paths[0]), path.resolve(__dirname, 'static', 'node_modules')) diff --git a/spec/fixtures/module/no-prototype.js b/spec/fixtures/module/no-prototype.js new file mode 100644 index 0000000000..b6c9d7a4fc --- /dev/null +++ b/spec/fixtures/module/no-prototype.js @@ -0,0 +1,4 @@ +module.exports = { + foo: Object.create(null), + bar: 1234 +}