Move phantom checks in test.'s to the document variable assignment.

Former-commit-id: 04a4c99398401d1d69236daa5eb0290db23a07d2
This commit is contained in:
John-David Dalton
2013-07-08 08:07:40 -07:00
parent d7f4f392d2
commit ee01c944b4

View File

@@ -2,12 +2,12 @@
'use strict'; 'use strict';
/** Method and object shortcuts */ /** Method and object shortcuts */
var document = window.document, var phantom = window.phantom,
document = !phantom && window.document,
amd = window.define && define.amd, amd = window.define && define.amd,
body = document && document.body, body = document && document.body,
create = Object.create, create = Object.create,
freeze = Object.freeze, freeze = Object.freeze,
phantom = window.phantom,
process = window.process, process = window.process,
slice = Array.prototype.slice, slice = Array.prototype.slice,
system = window.system, system = window.system,
@@ -117,7 +117,7 @@
// add object from iframe // add object from iframe
(function() { (function() {
if (!document || phantom) { if (!document) {
return; return;
} }
var iframe = document.createElement('iframe'); var iframe = document.createElement('iframe');
@@ -196,7 +196,7 @@
}); });
test('avoids overwritten native methods', function() { test('avoids overwritten native methods', function() {
if (document && !phantom) { if (document) {
notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []); notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []);
} else { } else {
skipTest(); skipTest();
@@ -3843,7 +3843,7 @@
// configure QUnit and call `QUnit.start()` for // configure QUnit and call `QUnit.start()` for
// Narwhal, Node.js, PhantomJS, Rhino, and RingoJS // Narwhal, Node.js, PhantomJS, Rhino, and RingoJS
if (!document || phantom) { if (!document) {
QUnit.config.noglobals = true; QUnit.config.noglobals = true;
QUnit.start(); QUnit.start();
} }