Merge pull request #2957 from Ms2ger/is-is_not

Use === for is() and is_not() in contenttests.
This commit is contained in:
Manish Goregaokar 2014-07-30 16:55:34 +05:30
commit 78991c896e
3 changed files with 7 additions and 7 deletions

View file

@ -20,8 +20,8 @@ function _printer(opstr, op) {
}; };
} }
var is = _printer("==", function (a,b) { return a == b; }); var is = _printer("===", function (a,b) { return a === b; });
var is_not = _printer("!=", function (a,b) { return a != b; }); var is_not = _printer("!==", function (a,b) { return a !== b; });
var is_a = _printer("is a", function (a,b) { return a instanceof b; }); var is_a = _printer("is a", function (a,b) { return a instanceof b; });
var is_not_a = _printer("is not a", function (a,b) { return !(a instanceof b); }); var is_not_a = _printer("is not a", function (a,b) { return !(a instanceof b); });
var is_in = _printer("is in", function (a,b) { return a in b; }); var is_in = _printer("is in", function (a,b) { return a in b; });

View file

@ -9,7 +9,7 @@
function check_collection(obj, num, classes, name) { function check_collection(obj, num, classes, name) {
is_a(obj, HTMLCollection); is_a(obj, HTMLCollection);
is(obj.length, num); is(obj.length, num);
is(obj[obj.length], null); is(obj[obj.length], undefined);
if (classes === undefined) if (classes === undefined)
return; return;
@ -17,7 +17,7 @@ function check_collection(obj, num, classes, name) {
classes = [Element, HTMLElement].concat(classes); classes = [Element, HTMLElement].concat(classes);
for (var i=0; i<obj.length; i++) { for (var i=0; i<obj.length; i++) {
is_not(obj[i], null); is_not(obj[i], undefined);
is(obj[i].tagName, name); is(obj[i].tagName, name);
for (var j=0; j<classes.length; j++) { for (var j=0; j<classes.length; j++) {
is_a(obj[i], classes[j]); is_a(obj[i], classes[j]);

View file

@ -20,11 +20,11 @@
} }
// test2: Node.namespaceURI // test2: Node.namespaceURI
{ {
is(document.namespaceURI, null, "test2.0: createElementNS"); is(document.namespaceURI, undefined, "test2.0: createElementNS");
is(document.documentElement.namespaceURI, "http://www.w3.org/1999/xhtml", "test2.1: createElementNS"); is(document.documentElement.namespaceURI, "http://www.w3.org/1999/xhtml", "test2.1: createElementNS");
var scriptElt = document.getElementById("script"); var scriptElt = document.getElementById("script");
is(scriptElt.firstChild.namespaceURI, null, "test2.2: createElementNS"); is(scriptElt.firstChild.namespaceURI, undefined, "test2.2: createElementNS");
is(scriptElt.nextSibling.namespaceURI, null, "test2.3: createElementNS"); is(scriptElt.nextSibling.namespaceURI, undefined, "test2.3: createElementNS");
} }
finish(); finish();