Re: [FILE-SYSTEM] Hoping the globals of the FileSystem spec are TEMPORARY and not PERSISTENT

On Wed, Jul 31, 2013 at 12:44 PM, David Bruant <bruant.d@gmail.com> wrote:
> Hi,
>
> The LocalFileSystem interface [1] defines the TEMPORARY and PERSISTENT
> constants and has the [NoInterfaceObject] extended attribute. It seems that
> the intention behind that choice was to expose these constants on the global
> object (see code snippets of [3] and the fact that these are indeed exposed
> as global properties in the console of a recent Chrome) [2].
>
> This is a bad idea: imagine all specs start defining constants on the global
> object! This is an unhealthy practice that endangers the scalability of the
> web platforms when it comes to exposing APIs.
>
> For that reason, I would like to ask here for the removal of these constants
> properties from the global. This leads to 2 concerns:
> 1) is this change web compatible?
> Google has been promoting this API and the use of these globals through code
> snippets (including [3]) pretty heavily. Among others Mega made pretty clear
> that they were using the API [5].
>
> 2) Assuming the answer to 1) is "yes", how and what's the replacement?
> One idea is to use strings:
>     window.requestFileSystem("temporary", size, onInitFs, errorHandler);
> That could work fine.

Yes, if change is possible, the correct idiom is to use an enum, not
constants, like your #2.

~TJ

Received on Wednesday, 31 July 2013 20:10:33 UTC