Closed whitmer closed 7 years ago
This will be a non-issue when #211 is resolved.
Do you want to propose an error message? Does a try-catch over the eval
do the trick?
This should now be fixed in master
. eval
is no longer used, whether for keys or cloning (courtesy of typeson/typeson-registry).
This one took me a little while to track down. Basically I'm running on a browser that follows CSP directives, and I didn't have 'unsafe-eval' set as an option for 'script-src'. I didn't realize IndexedDBShim was using eval, or maybe I would have caught it sooner. Anyway, the error that kept getting raised was "Could not eval key from keyPath" which would get triggered on storage calls. It was actually happening in the getValue function, which eval'ed "source.". Anyway, I'm assuming others will run across this as well, so this is partially documenting, and partially to say it should be easy to include a capability check and notify the developer if eval is not functioning properly.