MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / createQuickJSScriptInstance

Function createQuickJSScriptInstance

src/quickjs_backend.cpp:2704–2714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2702}
2703
2704wzapi::scripting_instance* createQuickJSScriptInstance(const WzString& path, int player, int difficulty)
2705{
2706 WzPathInfo basename = WzPathInfo::fromPlatformIndependentPath(path.toUtf8());
2707 quickjs_scripting_instance* pNewInstance = new quickjs_scripting_instance(player, basename.baseName(), basename.path());
2708 if (!pNewInstance->loadScript(path, player, difficulty))
2709 {
2710 delete pNewInstance;
2711 return nullptr;
2712 }
2713 return pNewInstance;
2714}
2715
2716bool QuickJS_EnumerateObjectProperties(JSContext *ctx, JSValue obj, const std::function<void (const char *key, JSAtom& atom)>& func, bool enumerableOnly /*= true*/)
2717{

Callers 1

Calls 3

baseNameMethod · 0.80
pathMethod · 0.80
loadScriptMethod · 0.80

Tested by

no test coverage detected