-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Open
Description
Prior to #57666, accessing the global localStorage would throw an error if --localstorage-file was invalid at the point of lazy initialisation.
Now, it provides an empty proxy object which responds undefined to all property access. This is neither spec-compliant nor straightforwardly observable.
Looking at the PR, it seems like this was an attempt to avoid throwing warnings in the test suite if simply testing for the presence of the global variable. It seems to me like the better approach would be for the tests to be changed (eg. by checking for the flag instead), and for the implementation to be kept sane.
A couple of options would be:
- Implement mcollina's original proposal, and have the getter warn and return
undefinedif the storage cannot be initialised. - The
localStorageglobal getter is allowed to throw a DOMException in the spec if the storage cannot be safely initialised, which is more abrupt, but arguably more consistent with the web.
TheJaredWilcurt, ssalbdivad, inoyakaigor, colinhacks and apo-daniel
Metadata
Metadata
Assignees
Labels
No labels