Skip to content

Commit

Permalink
quintusCore fixed to not override global 'window' object when using m…
Browse files Browse the repository at this point in the history
…odule.exports.
  • Loading branch information
benwiley4000 committed Jan 28, 2016
1 parent c97bbd9 commit 2800a78
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/quintus.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ various other modules:
@module Quintus
*/

var quintusCore = function(window,key) {
var quintusCore = function(exportTarget,key) {
"use strict";

/**
Expand All @@ -52,7 +52,7 @@ var quintusCore = function(window,key) {
@class Quintus
**/
var Quintus = window[key] = function(opts) {
var Quintus = exportTarget[key] = function(opts) {

/**
A la jQuery - the returned `Q` object is actually
Expand Down Expand Up @@ -2249,6 +2249,10 @@ var Quintus = window[key] = function(opts) {
// Lastly, add in the `requestAnimationFrame` shim, if necessary. Does nothing
// if `requestAnimationFrame` is already on the `window` object.
(function() {
if (typeof window === 'undefined') {
return;
}

var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
Expand Down

0 comments on commit 2800a78

Please sign in to comment.