Only use local storage if the API is declared and does not throw an exception#7723
Merged
jridgewell merged 5 commits intoampproject:masterfrom Feb 22, 2017
newmuis:android-local-storage
Merged
Only use local storage if the API is declared and does not throw an exception#7723jridgewell merged 5 commits intoampproject:masterfrom newmuis:android-local-storage
jridgewell merged 5 commits intoampproject:masterfrom
newmuis:android-local-storage
Conversation
jridgewell
requested changes
Feb 22, 2017
| .throws(new Error('unknown')) | ||
| .once(); | ||
| binding = new LocalStorageBinding(windowApi); | ||
| return binding.loadBlob('https://acme.com') |
Contributor
There was a problem hiding this comment.
I think we need another expects here, to show that we aren't using localstorage anymore.
…m local storage when local storage is not supported.
jridgewell
approved these changes
Feb 22, 2017
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.