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 c8f2bd5..7532339 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) ->