Replace typeof x !== 'undefined' checks with typeof x === 'object'.

This commit is contained in:
Jürg Lehni 2013-10-10 20:36:33 +02:00
parent 94fac965ec
commit 6b45a9382c
2 changed files with 2 additions and 3 deletions

View file

@ -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');

View file

@ -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,