From 64a8664ffe116426b021b1f879694c77a9192a28 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 15 May 2013 22:17:27 +0800 Subject: [PATCH] Fix places where Window should be BrowserWindow. --- browser/api/lib/dialog.coffee | 2 +- browser/atom/objects_registry.coffee | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/api/lib/dialog.coffee b/browser/api/lib/dialog.coffee index 71692df08a13..72e8eb9f5697 100644 --- a/browser/api/lib/dialog.coffee +++ b/browser/api/lib/dialog.coffee @@ -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 diff --git a/browser/atom/objects_registry.coffee b/browser/atom/objects_registry.coffee index 73613ae36aee..3dcdd58135d4 100644 --- a/browser/atom/objects_registry.coffee +++ b/browser/atom/objects_registry.coffee @@ -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