]> khamidou — GitHub mirrors - electron.git/commitdiff
Simpler way of inheriting EventEmitter.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 22 Apr 2013 08:11:56 +0000 (16:11 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 22 Apr 2013 08:11:56 +0000 (16:11 +0800)
browser/api/lib/window.coffee

index c8f2bd5b5e7f8545eb75e3bc99fc22d847442465..75323394615f74da7122786fbca055bd2695f6db 100644 (file)
@@ -1,10 +1,7 @@
 EventEmitter = require('events').EventEmitter
 
 Window = process.atom_binding('window').Window
-
-# Inherits EventEmitter.
-for prop, func of EventEmitter.prototype
-  Window.prototype[prop] = func
+Window.prototype.__proto__ = EventEmitter.prototype
 
 # Convient accessors.
 setupGetterAndSetter = (constructor, name, getter, setter) ->