| 2702 | } |
| 2703 | |
| 2704 | wzapi::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 | |
| 2716 | bool QuickJS_EnumerateObjectProperties(JSContext *ctx, JSValue obj, const std::function<void (const char *key, JSAtom& atom)>& func, bool enumerableOnly /*= true*/) |
| 2717 | { |
no test coverage detected