]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix places where Window should be BrowserWindow.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 15 May 2013 14:17:27 +0000 (22:17 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 15 May 2013 14:17:27 +0000 (22:17 +0800)
browser/api/lib/dialog.coffee
browser/atom/objects_registry.coffee

index 71692df08a1350284555125c760a7a795e8867e4..72e8eb9f5697e6f37d907d55d9a7f3a24e000357 100644 (file)
@@ -67,7 +67,7 @@ module.exports =
     selectFileWrap args..., 4, 'Open Files'
 
   showMessageBox: (window, options) ->
-    throw new TypeError('Need Window object') unless window.constructor is Window
+    throw new TypeError('Need Window object') unless window.constructor is BrowserWindow
 
     options = {} unless options?
     options.type = options.type ? module.exports.MESSAGE_BOX_NONE
index 73613ae36aee73816c8a09b7fa21e6166d7016fe..3dcdd58135d46cacc2544039e099217ca7dd52dc 100644 (file)
@@ -1,3 +1,4 @@
+BrowserWindow = require 'browser_window'
 IDWeakMap = require 'id_weak_map'
 
 class ObjectsStore
@@ -54,7 +55,7 @@ process.on 'ATOM_BROWSER_INTERNAL_NEW', (obj) ->
   objectsWeakMap.add obj
 
   # Also remember all windows.
-  windowsWeakMap.add obj if obj.constructor.name is 'Window'
+  windowsWeakMap.add obj if obj.constructor is BrowserWindow
 
 exports.add = (processId, routingId, obj) ->
   # Some native objects may already been added to objectsWeakMap, be care not