- From: Kinuko Yasuda <notifications@github.com>
- Date: Mon, 06 Apr 2015 22:15:14 -0700
- To: w3c/quota-api <quota-api@noreply.github.com>
- Message-ID: <w3c/quota-api/issues/3@github.com>
(Migrated from https://github.com/kinu/quota-api/issues/5)
>From https://github.com/w3ctag/spec-reviews/blob/master/2014/02/quota-management-api.md#dont-use-non-constructible-classes-as-namespaces
> This is essentially the same issue as the previous one (issue #4), but in this case we are discussing StorageQuota. Again, navigator.storageQuota has somehow sprung into being as the only instance of a class StorageQuota, which it is not possible to actually construct an instance of since it has no constructor.
As suggested in the spec reviews, navigator.storageQuota could be set up as a simple "namespace object," with no specially-crafted prototype chain, simply though something like
```
navigator.storageQuota = {
supportedTypes: Object.freeze(["temporary", "persistent"]),
queryInfo: function (type) { ... },
requestPersistentQuota: function (newQuota) { ... }
};
// Now correct the access modifiers
Object.defineProperties(navigator.storageQuota, {
supportedTypes: { writable: false },
queryInfo: { enumerable: false },
requestPersistentQuota: { enumerable: false }
});
```
---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/quota-api/issues/3
Received on Tuesday, 7 April 2015 05:15:47 UTC