src/jdk/nashorn/internal/runtime/PropertyMap.java

Print this page

        

@@ -381,10 +381,11 @@
      * @param other The source of properties.
      *
      * @return New {@link PropertyMap} with added properties.
      */
     public PropertyMap addAll(final PropertyMap other) {
+        assert this != other : "adding property map to itself";
         final Property[] otherProperties = other.properties.getProperties();
         final PropertyHashMap newProperties = properties.immutableAdd(otherProperties);
 
         final PropertyMap newMap = new PropertyMap(this, newProperties);
         for (final Property property : otherProperties) {