From 6b45a9382c61f7f394d1b14641efdf2a3fc62e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 10 Oct 2013 20:36:33 +0200 Subject: [PATCH] Replace typeof x !== 'undefined' checks with typeof x === 'object'. --- src/load.js | 3 +-- src/ui/View.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/load.js b/src/load.js index e8ce2548..ed120360 100644 --- a/src/load.js +++ b/src/load.js @@ -13,8 +13,7 @@ // This file uses PrePro to preprocess the paper.js source code on the fly in // the browser, avoiding the step of having to manually preprocess it after each // change. This is very useful during development of the library itself. - -if (typeof window !== 'undefined') { +if (typeof window === 'object') { // Browser based loading through PrePro: if (!window.include) { var scripts = document.getElementsByTagName('script'); diff --git a/src/ui/View.js b/src/ui/View.js index f43ff225..eca1fc29 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -75,7 +75,7 @@ var View = Base.extend(Callback, /** @lends View# */{ element.height = size.height; // TODO: Test this on IE: if (PaperScope.hasAttribute(element, 'stats') - && typeof Stats !== 'undefined') { + && typeof Stats === 'object') { this._stats = new Stats(); // Align top-left to the element var stats = this._stats.domElement,