Update to latest mujs.git commit 05cd646

This commit is contained in:
Alec Murphy
2025-09-09 10:49:03 -04:00
parent cc4f8dfa51
commit 57872fb45b
3 changed files with 10 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ static int jsB_ErrorX(js_State *J, js_Object *prototype)
js_defproperty(J, -2, "message", JS_DONTENUM);
}
if (jsB_stacktrace(J, 1))
js_defproperty(J, -2, "stackTrace", JS_DONTENUM);
js_defproperty(J, -2, "stack", JS_DONTENUM);
return 1;
}
@@ -71,7 +71,7 @@ static void js_newerrorx(js_State *J, const char *message, js_Object *prototype)
js_pushstring(J, message);
js_setproperty(J, -2, "message");
if (jsB_stacktrace(J, 0))
js_setproperty(J, -2, "stackTrace");
js_setproperty(J, -2, "stack");
}
#define DERROR(name, Name) \

View File

@@ -288,8 +288,10 @@ static void Sp_slice(js_State *J)
if (s < e)
Sp_substring_imp(J, str, s, e - s);
else
else if (s > e)
Sp_substring_imp(J, str, e, s - e);
else
js_pushliteral(J, "");
}
static void Sp_substring(js_State *J)
@@ -304,8 +306,10 @@ static void Sp_substring(js_State *J)
if (s < e)
Sp_substring_imp(J, str, s, e - s);
else
else if (s > e)
Sp_substring_imp(J, str, e, s - e);
else
js_pushliteral(J, "");
}
static void Sp_toLowerCase(js_State *J)

View File

@@ -147,7 +147,7 @@ static int nextrune(struct cstate *g)
g->yychar = '0';
return 1;
}
return 0;
return 1;
case 'u':
if (!g->source[0] || !g->source[1] || !g->source[2] || !g->source[3])
die(g, "unterminated escape sequence");
@@ -159,7 +159,7 @@ static int nextrune(struct cstate *g)
g->yychar = '0';
return 1;
}
return 0;
return 1;
case 0:
g->yychar = '0';
return 1;