Bug 510234 - localStorage.clear() doesn't actually delete its properties, r+sr=jst

This commit is contained in:
Honza Bambas 2009-11-11 21:39:34 +01:00
Родитель e2a03c1688
Коммит 6d8152bec7
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -161,6 +161,8 @@ function startTest()
// Clear the storage
localStorage.clear();
is("testB" in localStorage, false, "Keys are not in the JS scope of the storage");
is("testC" in localStorage, false, "Keys are not in the JS scope of the storage");
is(localStorage.length, 0, "The storage is empty [3]");
checkException(function() {localStorage.key(0);}, INDEX_SIZE_ERR); // this is unspecified!
checkException(function() {localStorage.key(-1);}, INDEX_SIZE_ERR);

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

@ -516,6 +516,12 @@ nsIDOMHTMLDocument_Write_customMethodCallCode = """
rv = self->%s(arg0);
"""
nsIDOMStorage_Clear_customMethodCallCode = """
nsresult rv = self->Clear();
if (NS_SUCCEEDED(rv))
JS_ClearScope(cx, obj);
"""
CSS2Properties_ = {
'thisType': 'nsICSSDeclaration',
'additionalArguments': 'const nsCSSProperty prop',
@ -568,6 +574,9 @@ customMethodCalls = {
'code': nsIDOMHTMLDocument_Write_customMethodCallCode % 'Writeln',
'canFail': True
},
'nsIDOMStorage_Clear': {
'code': nsIDOMStorage_Clear_customMethodCallCode
},
'nsIDOMCSS2Properties_': CSS2Properties_,
'nsIDOMNSCSS2Properties_': CSS2Properties_
}