| 1599 | } |
| 1600 | |
| 1601 | void doCreateWrappedObject(JSEntry& jsEntry, const Ref<DummyObject>& object) { |
| 1602 | auto& context = jsEntry.context; |
| 1603 | auto& exceptionTracker = jsEntry.exceptionTracker; |
| 1604 | auto wrappedObject = context.newWrappedObject(object, exceptionTracker); |
| 1605 | jsEntry.checkException(); |
| 1606 | |
| 1607 | // Make a circular reference to force the engine to use a proper GC to collect the object |
| 1608 | context.setObjectProperty(wrappedObject.get(), "self", wrappedObject.get(), exceptionTracker); |
| 1609 | jsEntry.checkException(); |
| 1610 | |
| 1611 | auto globalObject = context.getGlobalObject(exceptionTracker); |
| 1612 | jsEntry.checkException(); |
| 1613 | |
| 1614 | context.setObjectProperty(globalObject.get(), "wrappedObject", wrappedObject.get(), exceptionTracker); |
| 1615 | jsEntry.checkException(); |
| 1616 | } |
| 1617 | |
| 1618 | TEST_P(JSContextFixture, canGCWrappedObject) { |
| 1619 | SKIP_IF_V8("Ticket: 2259"); |
no test coverage detected