зеркало из https://github.com/electron/electron.git
Add failing spec for remote static members
This commit is contained in:
Родитель
5cc61089d9
Коммит
9e4665fbc4
|
@ -63,6 +63,16 @@ describe('ipc module', function () {
|
|||
assert.equal(a.foo.bar, 'baz')
|
||||
})
|
||||
|
||||
it('should work with static class members', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'remote-static.js'))
|
||||
assert.equal(typeof a.Foo, 'function')
|
||||
assert.equal(a.Foo.foo(), 3)
|
||||
assert.equal(a.Foo.bar, 'baz')
|
||||
|
||||
var foo = new a.Foo()
|
||||
assert.equal(foo.baz(), 123)
|
||||
})
|
||||
|
||||
it('handles circular references in arrays and objects', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'circular.js'))
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
class Foo {
|
||||
static foo() {
|
||||
return 3
|
||||
}
|
||||
|
||||
baz() {
|
||||
return 123
|
||||
}
|
||||
}
|
||||
|
||||
Foo.bar = 'baz'
|
||||
|
||||
module.exports = {
|
||||
Foo: Foo
|
||||
}
|
Загрузка…
Ссылка в новой задаче