MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / safeCast

Method safeCast

src/hx/cppia/Cppia.cpp:1288–1297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1286
1287
1288 static hx::Object * SLJIT_CALL safeCast(hx::Object *obj, TypeData *typeData )
1289 {
1290 if (!obj || !typeData->isClassOf(obj) )
1291 {
1292 CppiaCtx::getCurrent()->exception = HX_INVALID_CAST.mPtr;
1293 return 0;
1294 }
1295
1296 return obj;
1297 }
1298
1299 void genCode(CppiaCompiler *compiler, const JitVal &inDest,ExprType destType) HXCPP_OVERRIDE
1300 {

Callers

nothing calls this directly

Calls 1

isClassOfMethod · 0.80

Tested by

no test coverage detected