tiny fix
This commit is contained in:
parent
5962ba05ec
commit
d77deb5a06
2 changed files with 5 additions and 1 deletions
2
src/js.c
2
src/js.c
|
|
@ -31,7 +31,7 @@ static void js_win32_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void js_pmake_subdirectory_main(const char* name) {
|
static void js_pmake_subdirectory_main(const char* name) {
|
||||||
duk_eval_string(js_ctx, "main();");
|
duk_eval_string(js_ctx, "if(!this.main){\n console.log(\"No main function was defined!\");\n process.exit(1);}\nmain();");
|
||||||
}
|
}
|
||||||
|
|
||||||
static duk_ret_t js_pmake_subdirectory(duk_context* self) {
|
static duk_ret_t js_pmake_subdirectory(duk_context* self) {
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ for(var i = 1; i < ARGV.length; i++) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!this.main) {
|
||||||
|
console.log("No main function was defined!");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
main();
|
main();
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue