MCPcopy Create free account
hub / github.com/Snapchat/Valdi / doCreateWrappedObject

Function doCreateWrappedObject

valdi/test/integration/JSIntegrationTests.cpp:1601–1616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1599}
1600
1601void 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
1618TEST_P(JSContextFixture, canGCWrappedObject) {
1619 SKIP_IF_V8("Ticket: 2259");

Callers 1

TEST_PFunction · 0.85

Calls 5

getMethod · 0.65
newWrappedObjectMethod · 0.45
checkExceptionMethod · 0.45
setObjectPropertyMethod · 0.45
getGlobalObjectMethod · 0.45

Tested by

no test coverage detected