IE9 support #80

Open
DurhamG opened this Issue Feb 23, 2012 · 2 comments

Projects

None yet

2 participants

@DurhamG

I tweaked persistence.js slightly and it seems to work in IE9 now (using the in-memory store). Just replace your usages of __defineG/Setter__ like so:

Replace:
myobject.__defineGetter__(field, mycallback);
with:
Object.defineProperty(myobject, field, { get : myGetCallback, set : mySetCallback, enumerable : true, configurable : true });

It appears to work in IE9 and the latest versions of webkit.

The only other change I had to make was in LocalQueryCollection.prototype.add/addAll, I moved this._items.push(obj); to be above this._session.add(obj); instead of below it, because otherwise I was encountering infinite recursion. I don't know why that happened in IE and not Chrome.

@zefhemel
Collaborator
@DurhamG

Correct. I just call persistence.loadFromLocalStorage and persistence.saveToLocalStorage. To be fair, I haven't tested it extensively, but my data shows up and is persisted, so that's better than before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment