Use empty string constructor name when missing
This commit is contained in:
parent
d67dfd09fd
commit
a9b43a0fc9
2 changed files with 3 additions and 2 deletions
|
@ -31,10 +31,11 @@ describe('ipc module', function () {
|
|||
|
||||
it('should work when object has no prototype', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js'))
|
||||
assert.equal(a.foo.constructor.name, '')
|
||||
assert.equal(a.foo.bar, 'baz')
|
||||
assert.equal(a.foo.baz, false)
|
||||
assert.equal(a.bar, 1234)
|
||||
assert.equal(a.getConstructorName(Object.create(null)), 'Object')
|
||||
assert.equal(a.getConstructorName(Object.create(null)), '')
|
||||
assert.equal(a.getConstructorName(new (class {})), '')
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue