b=391557. p=johnmarsh. r=mfinkle, dietrich. a=mconnor. change Annotation.get to return null instead of throwing exceptions (whitespace cleanup too)

This commit is contained in:
mark.finkle%gmail.com 2007-09-25 19:46:35 +00:00
Родитель d559b5836e
Коммит 59858c85ee
2 изменённых файлов: 167 добавлений и 164 удалений

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

@ -801,7 +801,9 @@ Annotations.prototype = {
},
get : function(aName) {
return Utilities.annotations.getItemAnnotation(this._id, aName);
if (this.has(aName))
return Utilities.annotations.getItemAnnotation(this._id, aName);
return null;
},
set : function(aName, aValue, aExpiration) {

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

@ -85,6 +85,7 @@ function test() {
testBookmark.annotations.remove("testing/bookmark");
ok(!testBookmark.annotations.has("testing/bookmark"), "Checking existence of removed annotation");
is(gLastBookmarkAction, "testing/bookmark", "Check event handler for removing annotation");
is(testBookmark.annotations.get("testing/bookmark"), null, "Check existence of a missing annotation");
// quick annotation type tests
testBookmark.annotations.set("testing/bookmark/string", "annotate-this", 0);