use of com.oracle.truffle.api.object.LocationFactory in project graal by oracle.
the class LocationTest method testDeleteDeclaredProperty.
@Test
public void testDeleteDeclaredProperty() {
DynamicObject object = rootShape.newInstance();
object.define("a", new Object(), 0, new LocationFactory() {
public Location createLocation(Shape shape, Object value) {
return shape.allocator().declaredLocation(value);
}
});
Assert.assertTrue(object.containsKey("a"));
object.define("a", 42);
Assert.assertEquals(1, object.getShape().getPropertyCount());
object.delete("a");
Assert.assertFalse(object.containsKey("a"));
}
Aggregations