Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
22176:cd7ee4a382e4 | 22177:396c1d17a11a |
---|---|
286 ShapeImpl oldShape = getShape(); | 286 ShapeImpl oldShape = getShape(); |
287 Property existing = oldShape.getProperty(id); | 287 Property existing = oldShape.getProperty(id); |
288 if (existing == null) { | 288 if (existing == null) { |
289 updateShape(); | 289 updateShape(); |
290 oldShape = getShape(); | 290 oldShape = getShape(); |
291 Shape newShape = oldShape.addProperty(Property.create(id, oldShape.allocator().locationForValue(value, true, true), flags)); | 291 Shape newShape = oldShape.addProperty(Property.create(id, oldShape.allocator().locationForValue(value, true, value != null), flags)); |
292 updateShape(); | 292 updateShape(); |
293 newShape.getLastProperty().setGeneric(this, value, oldShape, newShape); | 293 newShape.getLastProperty().setGeneric(this, value, oldShape, newShape); |
294 } else { | 294 } else { |
295 defineExisting(id, value, flags, existing, oldShape); | 295 defineExisting(id, value, flags, existing, oldShape); |
296 } | 296 } |