servo: Merge #2957 - Use === for is() and is_not() in contenttests (from Ms2ger:is-is_not)

Source-Repo: https://github.com/servo/servo
Source-Revision: 78991c896ee5cbb213d8d33197af32278701d20f
This commit is contained in:
Ms2ger 2014-07-30 16:26:34 +05:01
Родитель c040e3cdee
Коммит ba95e13b0d
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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; });

Просмотреть файл

@ -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<obj.length; i++) {
is_not(obj[i], null);
is_not(obj[i], undefined);
is(obj[i].tagName, name);
for (var j=0; j<classes.length; j++) {
is_a(obj[i], classes[j]);

Просмотреть файл

@ -20,11 +20,11 @@
}
// 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");
var scriptElt = document.getElementById("script");
is(scriptElt.firstChild.namespaceURI, null, "test2.2: createElementNS");
is(scriptElt.nextSibling.namespaceURI, null, "test2.3: createElementNS");
is(scriptElt.firstChild.namespaceURI, undefined, "test2.2: createElementNS");
is(scriptElt.nextSibling.namespaceURI, undefined, "test2.3: createElementNS");
}
finish();