zefhemel/persistencejs — Issue #80: IE9 support
Author: Vickor
Created: 2012-02-23 18:40:44+00:00
State: open

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.