зеркало из https://github.com/mozilla/gecko-dev.git
Bug 959988 - Remove URLSearchParams.prototype.size, r=ehsan
This commit is contained in:
Родитель
a671e699c6
Коммит
d78d696355
|
@ -301,13 +301,6 @@ URLSearchParams::Delete(const nsAString& aName)
|
|||
NotifyObserver();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
URLSearchParams::Size()
|
||||
{
|
||||
Validate();
|
||||
return mSearchParams.Count();
|
||||
}
|
||||
|
||||
void
|
||||
URLSearchParams::DeleteAll()
|
||||
{
|
||||
|
|
|
@ -85,8 +85,6 @@ public:
|
|||
|
||||
void Delete(const nsAString& aName);
|
||||
|
||||
uint32_t Size();
|
||||
|
||||
void Stringify(nsString& aRetval)
|
||||
{
|
||||
Validate();
|
||||
|
|
|
@ -32,23 +32,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=887836
|
|||
is(u.has('foo'), false, 'URLSearchParams.has(foo)');
|
||||
is(u.get('foo'), '', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 0, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 0, 'URLSearchParams.size()');
|
||||
|
||||
u.append('foo', 'bar');
|
||||
is(u.has('foo'), true, 'URLSearchParams.has(foo)');
|
||||
is(u.get('foo'), 'bar', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 1, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 1, 'URLSearchParams.size()');
|
||||
|
||||
u.set('foo', 'bar2');
|
||||
is(u.get('foo'), 'bar2', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 1, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 1, 'URLSearchParams.size()');
|
||||
|
||||
is(u + "", "foo=bar2", "stringifier");
|
||||
|
||||
u.delete('foo');
|
||||
is(u.size, 0, 'URLSearchParams.size()');
|
||||
|
||||
runTest();
|
||||
}
|
||||
|
@ -57,10 +53,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=887836
|
|||
var u = new URLSearchParams();
|
||||
ok(u, "URLSearchParams created");
|
||||
u.append('foo', 'bar');
|
||||
is(u.size, 1, "u.size()");
|
||||
|
||||
var uu = new URLSearchParams(u);
|
||||
is(uu.size, 1, "uu.size()");
|
||||
is(uu.get('foo'), 'bar', 'uu.get()');
|
||||
|
||||
u.append('foo', 'bar2');
|
||||
|
@ -114,8 +108,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=887836
|
|||
is(all[k], checks[i].data[key][k], "value matches");
|
||||
}
|
||||
}
|
||||
|
||||
is(u.size, count, "size matches");
|
||||
}
|
||||
|
||||
runTest();
|
||||
|
|
|
@ -22,6 +22,5 @@ interface URLSearchParams {
|
|||
sequence<DOMString> getAll(DOMString name);
|
||||
boolean has(DOMString name);
|
||||
void set(DOMString name, DOMString value);
|
||||
readonly attribute unsigned long size;
|
||||
stringifier;
|
||||
};
|
||||
|
|
|
@ -29,23 +29,19 @@ onmessage = function() {
|
|||
is(u.has('foo'), false, 'URLSearchParams.has(foo)');
|
||||
is(u.get('foo'), '', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 0, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 0, 'URLSearchParams.size()');
|
||||
|
||||
u.append('foo', 'bar');
|
||||
is(u.has('foo'), true, 'URLSearchParams.has(foo)');
|
||||
is(u.get('foo'), 'bar', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 1, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 1, 'URLSearchParams.size()');
|
||||
|
||||
u.set('foo', 'bar2');
|
||||
is(u.get('foo'), 'bar2', 'URLSearchParams.get(foo)');
|
||||
is(u.getAll('foo').length, 1, 'URLSearchParams.getAll(foo)');
|
||||
is(u.size, 1, 'URLSearchParams.size()');
|
||||
|
||||
is(u + "", "foo=bar2", "stringify");
|
||||
|
||||
u.delete('foo');
|
||||
is(u.size, 0, 'URLSearchParams.size()');
|
||||
|
||||
runTest();
|
||||
}
|
||||
|
@ -54,10 +50,8 @@ onmessage = function() {
|
|||
var u = new URLSearchParams();
|
||||
ok(u, "URLSearchParams created");
|
||||
u.append('foo', 'bar');
|
||||
is(u.size, 1, "u.size()");
|
||||
|
||||
var uu = new URLSearchParams(u);
|
||||
is(uu.size, 1, "uu.size()");
|
||||
is(uu.get('foo'), 'bar', 'uu.get()');
|
||||
|
||||
u.append('foo', 'bar2');
|
||||
|
@ -111,8 +105,6 @@ onmessage = function() {
|
|||
is(all[k], checks[i].data[key][k], "value matches");
|
||||
}
|
||||
}
|
||||
|
||||
is(u.size, count, "size matches");
|
||||
}
|
||||
|
||||
runTest();
|
||||
|
|
Загрузка…
Ссылка в новой задаче