8043605: Enable history for empty property maps
authorattila
Wed, 21 May 2014 15:38:11 +0200
changeset 24763 20971b9687ec
parent 24762 96a251e57232
child 24764 722a9603b237
8043605: Enable history for empty property maps Reviewed-by: jlaskey, sundar
nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Wed May 21 12:52:58 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Wed May 21 15:38:11 2014 +0200
@@ -651,13 +651,11 @@
      * @param newMap   Modified {@link PropertyMap}.
      */
     private void addToHistory(final Property property, final PropertyMap newMap) {
-        if (!properties.isEmpty()) {
-            if (history == null) {
-                history = new WeakHashMap<>();
-            }
+        if (history == null) {
+            history = new WeakHashMap<>();
+        }
 
-            history.put(property, new SoftReference<>(newMap));
-        }
+        history.put(property, new SoftReference<>(newMap));
     }
 
     /**