diff truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java @ 22177:396c1d17a11a

DynamicObject#define should accept null values
author Andreas Woess <andreas.woess@oracle.com>
date Tue, 22 Sep 2015 13:06:21 +0200
parents dc83cc1f94f2
children 47172a9b40ac
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java	Fri Sep 18 17:07:55 2015 +0200
+++ b/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java	Tue Sep 22 13:06:21 2015 +0200
@@ -288,7 +288,7 @@
         if (existing == null) {
             updateShape();
             oldShape = getShape();
-            Shape newShape = oldShape.addProperty(Property.create(id, oldShape.allocator().locationForValue(value, true, true), flags));
+            Shape newShape = oldShape.addProperty(Property.create(id, oldShape.allocator().locationForValue(value, true, value != null), flags));
             updateShape();
             newShape.getLastProperty().setGeneric(this, value, oldShape, newShape);
         } else {