Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-09-04 16:12:53 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-04 16:12:53 +0400
commit2183ce711a4edfe070cd68be85cf40ac37daab55 (patch)
treedcbbc556a71c95f2d050eb6f4d410f2e899d0634 /tests/javascript/assets
parent11d69ff34b20dc0384683b379d0fe1030c813758 (diff)
refs #4996 many tests to make sure our query/selector engine works. had to patch quint in order to make the tests work :(
Diffstat (limited to 'tests/javascript/assets')
-rw-r--r--tests/javascript/assets/qunit.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/javascript/assets/qunit.js b/tests/javascript/assets/qunit.js
index 867688475c..836ab3c1bc 100644
--- a/tests/javascript/assets/qunit.js
+++ b/tests/javascript/assets/qunit.js
@@ -67,6 +67,23 @@
return errorString;
}
},
+
+ isNode = function (obj) {
+ if (typeof Node === 'object') {
+ return obj instanceof Node
+ }
+
+ return obj && typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName=== 'string';
+ },
+
+ isElement = function (obj) {
+ if (typeof HTMLElement === 'object') {
+ return obj instanceof HTMLElement
+ }
+
+ return obj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName==='string';
+ },
+
/**
* Makes a clone of an object using only Array or Object as base,
* and copies over the own enumerable properties.
@@ -80,7 +97,7 @@
for ( key in obj ) {
if ( hasOwn.call( obj, key ) ) {
val = obj[ key ];
- vals[ key ] = val === Object( val ) ? objectValues( val ) : val;
+ vals[ key ] = val === Object( val ) && !isNode(val) && !isElement(val) ? objectValues( val ) : val;
}
}
return vals;