mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Replace typeof x !== 'undefined' checks with typeof x === 'object'.
This commit is contained in:
parent
94fac965ec
commit
6b45a9382c
2 changed files with 2 additions and 3 deletions
|
@ -13,8 +13,7 @@
|
||||||
// This file uses PrePro to preprocess the paper.js source code on the fly in
|
// 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
|
// the browser, avoiding the step of having to manually preprocess it after each
|
||||||
// change. This is very useful during development of the library itself.
|
// change. This is very useful during development of the library itself.
|
||||||
|
if (typeof window === 'object') {
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
// Browser based loading through PrePro:
|
// Browser based loading through PrePro:
|
||||||
if (!window.include) {
|
if (!window.include) {
|
||||||
var scripts = document.getElementsByTagName('script');
|
var scripts = document.getElementsByTagName('script');
|
||||||
|
|
|
@ -75,7 +75,7 @@ var View = Base.extend(Callback, /** @lends View# */{
|
||||||
element.height = size.height;
|
element.height = size.height;
|
||||||
// TODO: Test this on IE:
|
// TODO: Test this on IE:
|
||||||
if (PaperScope.hasAttribute(element, 'stats')
|
if (PaperScope.hasAttribute(element, 'stats')
|
||||||
&& typeof Stats !== 'undefined') {
|
&& typeof Stats === 'object') {
|
||||||
this._stats = new Stats();
|
this._stats = new Stats();
|
||||||
// Align top-left to the element
|
// Align top-left to the element
|
||||||
var stats = this._stats.domElement,
|
var stats = this._stats.domElement,
|
||||||
|
|
Loading…
Reference in a new issue