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