From 9ad878e87740bfc509ffad37e24aeb3c6a561b0a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 30 Jul 2014 12:16:19 +0200 Subject: [PATCH] Use === for is() and is_not() in contenttests. The notion of equality used by == in JavaScript is not useful for testing. --- src/test/content/harness.js | 4 ++-- src/test/content/test_collections.html | 4 ++-- src/test/content/test_document_createElementNS.html | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/content/harness.js b/src/test/content/harness.js index 76540b2a1a5..48c41d214b1 100644 --- a/src/test/content/harness.js +++ b/src/test/content/harness.js @@ -20,8 +20,8 @@ function _printer(opstr, op) { }; } -var is = _printer("==", function (a,b) { return a == b; }); -var is_not = _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_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_in = _printer("is in", function (a,b) { return a in b; }); diff --git a/src/test/content/test_collections.html b/src/test/content/test_collections.html index 0c0f9aa04aa..61cf77ed61f 100644 --- a/src/test/content/test_collections.html +++ b/src/test/content/test_collections.html @@ -9,7 +9,7 @@ function check_collection(obj, num, classes, name) { is_a(obj, HTMLCollection); is(obj.length, num); - is(obj[obj.length], null); + is(obj[obj.length], undefined); if (classes === undefined) return; @@ -17,7 +17,7 @@ function check_collection(obj, num, classes, name) { classes = [Element, HTMLElement].concat(classes); for (var i=0; i