From c757c3d3c68f7ea49d7eeece9f7d41b2facbdfbf Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 16 Sep 2014 17:36:33 +0200 Subject: [PATCH] Fix Exception when cleaning up. Support for web components tag names --- .../main/java/com/google/gwt/query/client/GQuery.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 2570f411..ddf72475 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -171,7 +171,7 @@ public class GQuery implements Lazy { */ private static DocumentStyleImpl styleImpl; - private static RegExp tagNameRegex = RegExp.compile("<([\\w:]+)"); + private static RegExp tagNameRegex = RegExp.compile("<([\\w:-]+)"); /** * Static reference to the Widgets plugin @@ -3848,9 +3848,10 @@ public class GQuery implements Lazy { if (name != null) { if (dataCache.exists(id)) { dataCache.getCache(id).delete(name); - } - if (dataCache.getCache(id).isEmpty()) { - removeData(item, null); + if (dataCache.getCache(id).isEmpty()) { + // Save memory + removeData(item, null); + } } } else { // when the element cache is empty we remove its entry to save memory (issue 132) -- 2.39.5