Skip to content

Only use local storage if the API is declared and does not throw an exception#7723

Merged
jridgewell merged 5 commits intoampproject:masterfrom
newmuis:android-local-storage
Feb 22, 2017
Merged

Only use local storage if the API is declared and does not throw an exception#7723
jridgewell merged 5 commits intoampproject:masterfrom
newmuis:android-local-storage

Conversation

@newmuis
Copy link
Copy Markdown
Contributor

@newmuis newmuis commented Feb 22, 2017

Fix for #6633

FYI: There's still the possibility of this error surfacing if access to local storage is somehow revoked after the binding is constructed.

@newmuis newmuis changed the title Android local storage Only use local storage if the API is declared and does not throw an exception Feb 22, 2017
@newmuis newmuis requested a review from jridgewell February 22, 2017 18:26
.throws(new Error('unknown'))
.once();
binding = new LocalStorageBinding(windowApi);
return binding.loadBlob('https://acme.com')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need another expects here, to show that we aren't using localstorage anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

…m local storage when local storage is not supported.
@jridgewell jridgewell merged commit 4154f8e into ampproject:master Feb 22, 2017
@newmuis newmuis deleted the android-local-storage branch February 23, 2017 19:05
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
…xception (ampproject#7723)

* Only use local storage if the API is declared and does not throw an exception (ampproject#6633)

* Revert "Only use local storage if the API is declared and does not throw an exception (ampproject#6633)"

This reverts commit fb0f11f.

* Only use local storage if the API is declared and does not throw an exception (ampproject#6633)

* Fix whitespace lint issue

* Ensure that getItem is not called when attempting to load an item from local storage when local storage is not supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants