Restoring JerryScript a bit cleaner

This commit is contained in:
2026-06-01 21:52:36 -05:00
parent 41a4be678e
commit 8f78bba9e9
27 changed files with 1459 additions and 4 deletions
+47
View File
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
typedef struct {
bool_t initialized;
} script_t;
extern script_t SCRIPT;
/**
* Initializes the script system, starting up JerryScript and registering all
* built-in modules.
*
* @return Any error that occurred.
*/
errorret_t scriptInit(void);
/**
* Evaluates a JS source string in the global scope.
*
* @param source Null-terminated JS source to evaluate.
* @return Any error that occurred.
*/
errorret_t scriptExecString(const char_t *source);
/**
* Loads and evaluates a script asset from the archive. The result is cached
* by the asset system; repeated calls with the same path do not re-execute.
*
* @param path Path of the script inside the asset archive.
* @return Any error that occurred.
*/
errorret_t scriptExecFile(const char_t *path);
/**
* Disposes of the script system and shuts down JerryScript.
*
* @return Any error that occurred.
*/
errorret_t scriptDispose(void);