LibWeb: Stub CacheStorage::has()

This is a step to get https://web.telegram.org/a/ login working.
This commit is contained in:
Aliaksandr Kalenik 2025-06-07 23:48:06 +02:00 committed by Alexander Kalenik
commit d8c86a2b09
Notes: github-actions[bot] 2025-06-08 16:27:26 +00:00
3 changed files with 9 additions and 1 deletions

View file

@ -30,4 +30,11 @@ GC::Ref<WebIDL::Promise> CacheStorage::open(String const&)
return WebIDL::create_rejected_promise(realm(), WebIDL::NotSupportedError::create(realm(), "CacheStorage.open() is not yet implemented"_string));
}
// https://w3c.github.io/ServiceWorker/#cache-storage-has
GC::Ref<WebIDL::Promise> CacheStorage::has(String const&)
{
dbgln("FIXME: CacheStorage::has() is not implemented yet");
return WebIDL::create_rejected_promise(realm(), JS::Value(false));
}
}

View file

@ -17,6 +17,7 @@ class CacheStorage : public Bindings::PlatformObject {
GC_DECLARE_ALLOCATOR(CacheStorage);
public:
GC::Ref<WebIDL::Promise> has(String const& cache_name);
GC::Ref<WebIDL::Promise> open(String const& cache_name);
private:

View file

@ -4,7 +4,7 @@
[SecureContext, Exposed=(Window,Worker)]
interface CacheStorage {
//[NewObject] Promise<(Response or undefined)> match(RequestInfo request, optional MultiCacheQueryOptions options = {});
//[NewObject] Promise<boolean> has(DOMString cacheName);
[NewObject] Promise<boolean> has(DOMString cacheName);
[NewObject] Promise<Cache> open(DOMString cacheName);
//[NewObject] Promise<boolean> delete(DOMString cacheName);
//[NewObject] Promise<sequence<DOMString>> keys();