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

Method runObject

src/hx/cppia/Cppia.cpp:1197–1222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195
1196
1197 hx::Object *runObject(CppiaCtx *ctx) HXCPP_OVERRIDE
1198 {
1199 if (op==castInt)
1200 return Dynamic(value->runInt(ctx)).mPtr;
1201 else if (op==castFloat)
1202 return Dynamic(value->runFloat(ctx)).mPtr;
1203 else if (op==castBool)
1204 return Dynamic((bool)value->runInt(ctx)).mPtr;
1205 else if (op==castString)
1206 return Dynamic(value->runString(ctx)).mPtr;
1207
1208 hx::Object *obj = value->runObject(ctx);
1209 if (op==castInstance)
1210 {
1211 if ( !obj || !typeData->isClassOf(obj) )
1212 hx::BadCast();
1213 return obj;
1214 }
1215 else if (!obj)
1216 return 0;
1217
1218 if (op==castDynamic)
1219 return obj;
1220
1221 return DynamicToArrayType(obj, arrayType);
1222 }
1223
1224 const char *getName() HXCPP_OVERRIDE { return "CastExpr"; }
1225

Callers

nothing calls this directly

Calls 8

BadCastFunction · 0.85
DynamicToArrayTypeFunction · 0.85
isClassOfMethod · 0.80
DynamicClass · 0.50
runIntMethod · 0.45
runFloatMethod · 0.45
runStringMethod · 0.45
runObjectMethod · 0.45

Tested by

no test coverage detected