diff --git a/meson.build b/meson.build index 090924fc..bd195229 100644 --- a/meson.build +++ b/meson.build @@ -151,7 +151,9 @@ core = custom_target('core.zip', 'cd ' + meson.project_source_root() + ' && echo "Rebuilding core.zip" && rm -f ' + meson.current_build_dir() + '/core.zip && ' + 'zip -r ' + meson.current_build_dir() + '/core.zip scripts fonts icons shaders' - ] + ], + build_always: true, + build_by_default: true ) prosperon_raw = executable('prosperon_raw', sources, @@ -179,7 +181,8 @@ prosperon = custom_target('prosperon', '@INPUT1@', '@OUTPUT@' ], - build_always: true + build_always: true, + build_by_default: true ) prosperon_dep = declare_dependency( @@ -194,7 +197,8 @@ copy_tests = custom_target( join_paths(meson.source_root(), 'tests'), meson.build_root() ], - build_always: true + build_always: true, + build_by_default: true ) tests = [ diff --git a/scripts/core/engine.js b/scripts/core/engine.js index 75452249..c7d911de 100644 --- a/scripts/core/engine.js +++ b/scripts/core/engine.js @@ -1237,11 +1237,10 @@ var script_fn = function script_fn(path) { throw new Error(`Module ${module_name} must return a value`) parsed.module_fn = module_fn } - - if (parsed.program) { - var prog_script = `(function use_${module_name}() { var self = this; var $ = this.__proto__; ${parsed.program}})` - parsed.prog_fn = js.eval(file, prog_script) - } + + parsed.program ??= "" + var prog_script = `(function use_${module_name}() { var self = this; var $ = this.__proto__; ${parsed.program}})` + parsed.prog_fn = js.eval(file, prog_script) return parsed }.hashify() diff --git a/source/jsffi.c b/source/jsffi.c index ae589786..88b3776e 100644 --- a/source/jsffi.c +++ b/source/jsffi.c @@ -5881,8 +5881,10 @@ static const JSCFunctionListEntry js_debug_funcs[] = { JSC_SCALL(io_rm, if (!PHYSFS_delete(str)) ret = JS_ThrowReferenceError(js,"could not remove %s. %s", str, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); ) + JSC_SCALL(io_mkdir, - if (!PHYSFS_mkdir(str)) ret = JS_ThrowReferenceError(js,"could not make directory %s. %s", str, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));) + if (!PHYSFS_mkdir(str)) ret = JS_ThrowReferenceError(js,"could not make directory %s. %s", str, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); +) JSC_SCALL(io_exists, ret = JS_NewBool(js,PHYSFS_exists(str)); ) diff --git a/tests/empty.js b/tests/empty.js index 1788a682..e69de29b 100644 --- a/tests/empty.js +++ b/tests/empty.js @@ -1 +0,0 @@ -os.exit(1)