http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImpl.java File user/src/com/google/gwt/storage/client/StorageImpl.java (right):
http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImpl.java#newcode193 user/src/com/google/gwt/storage/client/StorageImpl.java:193: @com.google.gwt.storage.client.StorageImpl::jsHandler = function(event) { On 2011/03/04 18:50:34, jlabanca wrote:
This function assignment should be wrapped with $entry to ensure that
it GWT can
capture events properly. See DOMImplStandard for an example.
@com.google.gwt.storage.client.StorageImpl::jsHandler =
$entry(function(event) {
... }}});
Done. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImpl.java#newcode193 user/src/com/google/gwt/storage/client/StorageImpl.java:193: @com.google.gwt.storage.client.StorageImpl::jsHandler = function(event) { On 2011/03/04 18:50:34, jlabanca wrote:
This function assignment should be wrapped with $entry to ensure that
it GWT can
capture events properly. See DOMImplStandard for an example.
@com.google.gwt.storage.client.StorageImpl::jsHandler =
$entry(function(event) {
... }}});
Done. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplIE8.java File user/src/com/google/gwt/storage/client/StorageImplIE8.java (right): http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplIE8.java#newcode33 user/src/com/google/gwt/storage/client/StorageImplIE8.java:33: public native String key(String storage, int index) /*-{ On 2011/03/04 18:50:34, jlabanca wrote:
This is that same as StorageImplNonNativeEvents.key(). We can just
get ride of
this Impl version.
It was a mistake for them to be the same--StorageImplNonNativeEvents shouldn't have had the index bounds check. I've removed it from there. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplMozilla.java File user/src/com/google/gwt/storage/client/StorageImplMozilla.java (right): http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplMozilla.java#newcode34 user/src/com/google/gwt/storage/client/StorageImplMozilla.java:34: public native String key(String storage, int index) /*-{ On 2011/03/04 18:50:34, jlabanca wrote:
This is that same as StorageImplNonNativeEvents.key(). We can just
get ride of
this Impl version.
StorageImplNonNativeEvents shouldn't have the index bounds check, that was a mistake. I've removed the check from StorageImplNonNativeEvents so this is needed after all. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java File user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java (right): http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java#newcode29 user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java:29: class StorageImplNonNativeEvents extends StorageImpl { On 2011/03/04 18:50:34, jlabanca wrote:
Most of the overrides in this class could be made non-native and use
calls to
the super.method() plus some other stuff.
Was able to remove tons of duplicated code, thanks for pointing that out. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java#newcode53 user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java:53: final StorageEvent.Handler handler) { On 2011/03/04 18:50:34, jlabanca wrote:
It might be cleaner to just override addStorageEventHandler0/removeStorageEventHandler0 to be no-op
methods. Done. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java#newcode64 user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java:64: $wnd[storage].clear(); On 2011/03/04 18:50:34, jlabanca wrote:
Make non-native: super.clear(); fireStorageEvent(...);
Done. http://gwt-code-reviews.appspot.com/1374803/diff/1/user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java#newcode87 user/src/com/google/gwt/storage/client/StorageImplNonNativeEvents.java:87: StorageEvent.Handler handler) { On 2011/03/04 18:50:35, jlabanca wrote:
Override removeStorageEventHandler0 instead of this method.
Done. http://gwt-code-reviews.appspot.com/1374803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors