- From: Dominique Hazael-Massieux via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 23 May 2011 16:09:35 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/contacts/tests/test-cases In directory hutz:/tmp/cvs-serv26668 Modified Files: common.js Log Message: bug fix in variable scope Index: common.js =================================================================== RCS file: /sources/public/2009/dap/contacts/tests/test-cases/common.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- common.js 23 May 2011 15:08:23 -0000 1.2 +++ common.js 23 May 2011 16:09:33 -0000 1.3 @@ -37,15 +37,15 @@ "urls": _contact_fields, "timezone": "string"}; -function assert_is_contact(contact) { - for (i in _contact_properties) { - assert_own_property(contact, i); +function assert_is_contact(actual) { + for (var i in _contact_properties) { + assert_own_property(actual, i); } } -function assert_contact_same_as(contact, refContact) { - for (field in _contact_properties) { - _compare_field(contact[field], refContact[field], field, _contact_properties[field]); +function assert_contact_same_as(actual, expected) { + for (var field in _contact_properties) { + _compare_field(actual[field], expected[field], field, _contact_properties[field]); } } @@ -57,7 +57,7 @@ assert_equals(actual, expected, "Comparing values of " + fieldname); } } else if (datatype instanceof Array) { - for (i in expected) { + for (var i in expected) { _compare_field(actual[i], expected[i], fieldname, datatype[0]); } } else if (typeof(datatype)=='object') { @@ -65,8 +65,8 @@ assert_own_property(expected, i, "Unexpected property " + i + " in " + fieldname); _compare_field(actual[i], expected[i], fieldname + "." + i, "string"); } - for (var i in expected) { - assert_own_property(actual, i, "Missing property " + i + " in " + fieldname); + for (var j in expected) { + assert_own_property(actual, j, "Missing property " + j + " in " + fieldname); } } else { assert_unreached( "Unknown datatype to compare:" + datatype);
Received on Monday, 23 May 2011 16:09:36 UTC