| 1287 | } |
| 1288 | |
| 1289 | tsn_vm* tsn_init(int /*argc*/, const char** /*argv*/) { |
| 1290 | auto* runtime = JS_NewRuntime(); |
| 1291 | if (runtime == nullptr) { |
| 1292 | return nullptr; |
| 1293 | } |
| 1294 | |
| 1295 | tsn_update_stack_limit(runtime); |
| 1296 | |
| 1297 | auto* ctx = JS_NewContext(runtime); |
| 1298 | if (runtime == nullptr) { |
| 1299 | JS_FreeRuntime(runtime); |
| 1300 | return nullptr; |
| 1301 | } |
| 1302 | tsn_add_helpers(ctx); |
| 1303 | tsn_load_in_context(ctx); |
| 1304 | return ctx; |
| 1305 | } |
| 1306 | |
| 1307 | bool tsn_contains_module(const char* module_name) { |
| 1308 | tsn_module_info output; |
no test coverage detected