diff --git a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java index 9221834331177ee4c6fb208c8695b399f7af0481..4e685581faf57cd52ae69467e93a7c229dde9220 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java @@ -651,13 +651,11 @@ public final class PropertyMap implements Iterable { * @param newMap Modified {@link PropertyMap}. */ private void addToHistory(final Property property, final PropertyMap newMap) { - if (!properties.isEmpty()) { - if (history == null) { - history = new WeakHashMap<>(); - } - - history.put(property, new SoftReference<>(newMap)); + if (history == null) { + history = new WeakHashMap<>(); } + + history.put(property, new SoftReference<>(newMap)); } /**