diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 47f2eef216..c5e38e83e4 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -187,6 +187,18 @@ describe('ipc module', function () { property.property = 1127 }) + it('rethrows errors getting/setting properties', function () { + const foo = remote.require(path.join(fixtures, 'module', 'error-properties.js')) + + assert.throws(function () { + foo.bar + }, /getting error/) + + assert.throws(function () { + foo.bar = 'test' + }, /setting error/) + }) + it('can construct an object from its member', function () { var call = remote.require(path.join(fixtures, 'module', 'call.js')) var obj = new call.constructor() diff --git a/spec/fixtures/module/error-properties.js b/spec/fixtures/module/error-properties.js new file mode 100644 index 0000000000..c3a1e3b3a7 --- /dev/null +++ b/spec/fixtures/module/error-properties.js @@ -0,0 +1,11 @@ +class Foo { + set bar (value) { + throw new Error('setting error') + } + + get bar () { + throw new Error('getting error') + } +} + +module.exports = new Foo()