thatcher / env-js

A pure-JavaScript browser environment.
http://www.envjs.com/
463 stars 75 forks source link

Adding localStorage to env-js #27

Closed clutchski closed 12 years ago

clutchski commented 13 years ago

Hey all,

Here's a small patch to emulate localStorage in env-js. I cribbed the code from a google groups post[1] and added a few simple tests and build integration. Though this patch is sufficient for my needs (testing some app javascript front end code), it does differ from the localStorage spec [2] in a few ways, namely: it doesn't persist across sessions, enforce authorization by domain or trigger storage events.

I'd really love to see localStorage in env-js, so if these are must-do features, let me know and I'll take a pass at them. Let me know what you think.

Thanks, Matt

[1] - http://groups.google.com/group/envjs/msg/8327d6c0e429ab80 [2] - http://dev.w3.org/html5/webstorage/#dom-localstorage