Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mujs for openSUSE:Factory checked in at 2025-07-15 16:41:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mujs (Old) and /work/SRC/openSUSE:Factory/.mujs.new.7373 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mujs" Tue Jul 15 16:41:30 2025 rev:13 rq:1292458 version:1.3.7 Changes: -------- --- /work/SRC/openSUSE:Factory/mujs/mujs.changes 2024-12-16 19:08:56.154046954 +0100 +++ /work/SRC/openSUSE:Factory/.mujs.new.7373/mujs.changes 2025-07-15 16:41:32.662244764 +0200 @@ -1,0 +2,9 @@ +Sat Jul 12 20:20:29 UTC 2025 - Илья Индиго <[email protected]> + +- Updated to 1.3.7 + * Added ucd-16.0.0.tar.xz tarball with Unicode specifications. + * https://github.com/ccxvii/mujs/compare/1.3.5...1.3.7 + * Updated character tables to Unicode 16. + * Used more common "stack" property for error stack trace. + +------------------------------------------------------------------- @@ -34,3 +43,3 @@ - * 1.3.2 patch release for UAF bug fix. - * Bug 706057: Fix use-after-free in getOwnPropertyDescriptor. - * Set length of output array Array.prototype.map. + * 1.3.2 patch release for UAF bug fix. + * Bug 706057: Fix use-after-free in getOwnPropertyDescriptor. + * Set length of output array Array.prototype.map. @@ -39,4 +48,4 @@ - * Make a patch release for important iterator bug fix. - * Issue #166: Use special iterator for string and array indices. - * Enable choice of library version for shell - * Use $(@D) instead of $(dir $@) + * Make a patch release for important iterator bug fix. + * Issue #166: Use special iterator for string and array indices. + * Enable choice of library version for shell + * Use $(@D) instead of $(dir $@) @@ -45,14 +54,14 @@ - * Avoid freeing buffer twice in case of error. - * Fast path for "simple" arrays. - * Bug 705775: Fix double fclose in pretty-printing tool. - * Makefile: fix parallel builds - * Guard state initialization with try to avoid panic in initialization. - * Add js_isbooleanobject and js_isdateobject functions. - * Issue #161: Cope with empty programs in mujs-pp. - * Issue #161: Don't fclose a FILE that is NULL. - * Issue #162: Check stack overflow during regexp compilation. - * Bug 705052: Don't use private STACK/TOP macros in jsstate.c - * Add "console" object to mujs shell. - * Issue #156: Fix check for duplicate formal parameters when strict. - * Some minor optimizations to Ap_join. - * array join: avoid strcat, speedup from O(N^2) to O(N) + * Avoid freeing buffer twice in case of error. + * Fast path for "simple" arrays. + * Bug 705775: Fix double fclose in pretty-printing tool. + * Makefile: fix parallel builds + * Guard state initialization with try to avoid panic in initialization. + * Add js_isbooleanobject and js_isdateobject functions. + * Issue #161: Cope with empty programs in mujs-pp. + * Issue #161: Don't fclose a FILE that is NULL. + * Issue #162: Check stack overflow during regexp compilation. + * Bug 705052: Don't use private STACK/TOP macros in jsstate.c + * Add "console" object to mujs shell. + * Issue #156: Fix check for duplicate formal parameters when strict. + * Some minor optimizations to Ap_join. + * array join: avoid strcat, speedup from O(N^2) to O(N) Old: ---- mujs-1.3.5.tar.gz New: ---- _scmsync.obsinfo build.specials.obscpio mujs-1.3.7.tar.gz ucd-16.0.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mujs.spec ++++++ --- /var/tmp/diff_new_pack.OpCzfq/_old 2025-07-15 16:41:33.510280184 +0200 +++ /var/tmp/diff_new_pack.OpCzfq/_new 2025-07-15 16:41:33.514280351 +0200 @@ -1,7 +1,7 @@ # # spec file for package mujs # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,20 +16,20 @@ # +%define ucd_ver 16.0.0 Name: mujs -Version: 1.3.5 +Version: 1.3.7 Release: 0 Summary: An embeddable Javascript interpreter License: AGPL-3.0-or-later Group: Development/Languages/C and C++ -URL: https://mujs.com -Source0: https://mujs.com/downloads/%{name}-%{version}.tar.gz +URL: https://github.com/ccxvii/%{name} +Source0: https://github.com/ccxvii/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# v=16.0.0 && u=https://www.unicode.org/Public/$v/ucd && f1=SpecialCasing.txt && f2=UnicodeData.txt && f=ucd-$v.tar.xz && cd /tmp && curl -O $u/$f1 -O $u/$f2 && tar c --remove-files "$f1" "$f2" | xz -9e > "$f" +Source1: ucd-%{ucd_ver}.tar.xz BuildRequires: pkgconfig -%if 0%{?suse_version} > 1500 +BuildRequires: python3 BuildRequires: pkgconfig(readline) -%else -BuildRequires: readline-devel -%endif %description MuJS is a lightweight Javascript interpreter designed for embedding in other software to extend them with scripting capabilities. @@ -43,20 +43,19 @@ This package provides the MuJS static library. %prep -%autosetup -p1 +%autosetup -p1 -a1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects -%make_build debug CFLAGS="%{optflags} -fPIC" +%make_build CFLAGS="%{optflags} -fPIC" %install -%make_install prefix="%{_prefix}" libdir="%{_libdir}" CFLAGS="%{optflags} -fPIC" +%make_install CFLAGS="%{optflags} -fPIC" prefix="%{_prefix}" libdir="%{_libdir}" %files %license COPYING %doc AUTHORS README -%{_bindir}/%{name} -%{_bindir}/%{name}-pp +%{_bindir}/%{name}{,-pp} %files devel %license COPYING ++++++ _scmsync.obsinfo ++++++ mtime: 1752351936 commit: ebe69e3e6931f0b59ab7e06545e587b09eb48ba5a8296996c53e0f73f62980b0 url: https://src.opensuse.org/javascript/mujs.git revision: ebe69e3e6931f0b59ab7e06545e587b09eb48ba5a8296996c53e0f73f62980b0 projectscmsync: https://src.opensuse.org/javascript/_ObsPrj.git ++++++ mujs-1.3.5.tar.gz -> mujs-1.3.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/Makefile new/mujs-1.3.7/Makefile --- old/mujs-1.3.5/Makefile 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/Makefile 2025-06-23 14:15:36.000000000 +0200 @@ -29,7 +29,7 @@ CFLAGS += -I/usr/local/include -L/usr/local/lib endif -HDRS = mujs.h jsi.h regexp.h utf.h astnames.h opnames.h +HDRS = mujs.h jsi.h regexp.h utf.h astnames.h opnames.h utfdata.h ifneq ($(HAVE_READLINE),no) READLINE_CFLAGS = -DHAVE_READLINE @@ -73,10 +73,12 @@ grep -E '\<OP_' jsi.h | sed 's/^[^A-Z]*OP_/"/;s/,.*/",/' | tr A-Z a-z > $@ UnicodeData.txt: - curl -s -o $@ https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt + curl -s -o $@ https://www.unicode.org/Public/16.0.0/ucd/UnicodeData.txt +SpecialCasing.txt: + curl -s -o $@ https://www.unicode.org/Public/16.0.0/ucd/SpecialCasing.txt -utfdata.h: genucd.py UnicodeData.txt - python3 genucd.py UnicodeData.txt >$@ +utfdata.h: genucd.py UnicodeData.txt SpecialCasing.txt + python3 genucd.py UnicodeData.txt SpecialCasing.txt >$@ build/sanitize/mujs: main.c one.c $(SRCS) $(HDRS) @mkdir -p $(@D) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/README new/mujs-1.3.7/README --- old/mujs-1.3.5/README 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/README 2025-06-23 14:15:36.000000000 +0200 @@ -48,5 +48,3 @@ Report bugs on the ghostscript bugzilla, with MuJS as the selected component. http://bugs.ghostscript.com/ - -The MuJS developers hang out on IRC in the #mupdf channel on irc.freenode.net. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/genucd.py new/mujs-1.3.7/genucd.py --- old/mujs-1.3.5/genucd.py 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/genucd.py 2025-06-23 14:15:36.000000000 +0200 @@ -1,9 +1,11 @@ -# Create utfdata.h from UnicodeData.txt +# Create utfdata.h from UnicodeData.txt and SpecialCasing.txt import sys tolower = [] toupper = [] +tolower_full = [] +toupper_full = [] isalpha = [] for line in open(sys.argv[1]).readlines(): @@ -17,6 +19,32 @@ if line[13]: tolower.append((code,int(line[13],16))) +for line in open(sys.argv[2]).readlines(): + # SpecialCasing.txt -- code; lower; title; upper; (condition;)? # comment + line = line.strip() + if len(line) == 0: + continue + if line[0] == "#": + continue + line = line.split(";") + code = int(line[0],16) + lower = line[1].strip() + upper = line[3].strip() + if len(lower) == 0 or len(upper) == 0: + continue + condition = line[4].split("#")[0].strip() + if len(condition) > 0: + continue + lower = list(map(lambda x: int(x,16), lower.split(" "))) + upper = list(map(lambda x: int(x,16), upper.split(" "))) + if lower[0] != code: + tolower_full.append([code] + lower) + if upper[0] != code: + toupper_full.append([code] + upper) + +tolower_full.sort() +toupper_full.sort() + def dumpalpha(): table = [] prev = 0 @@ -73,7 +101,17 @@ print(hex(a)+","+str(n-a)+",") print("};"); +def dumpmultimap(name, table, w): + print("") + print("static const Rune " + name + "[] = {") + for list in table: + list += [0] * (w - len(list)) + print(",".join(map(hex, list)) + ",") + print("};") + print("/* This file was automatically created from " + sys.argv[1] + " */") dumpalpha() dumpmap("ucd_tolower", tolower) dumpmap("ucd_toupper", toupper) +dumpmultimap("ucd_tolower_full", tolower_full, 4) +dumpmultimap("ucd_toupper_full", toupper_full, 5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jsarray.c new/mujs-1.3.7/jsarray.c --- old/mujs-1.3.5/jsarray.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jsarray.c 2025-06-23 14:15:36.000000000 +0200 @@ -1,5 +1,9 @@ #include "jsi.h" +#ifndef JS_HEAPSORT +#define JS_HEAPSORT 0 +#endif + int js_getlength(js_State *J, int idx) { int len; @@ -233,97 +237,174 @@ js_setindex(J, -2, n); } -struct sortslot { - js_Value v; - js_State *J; -}; - -static int sortcmp(const void *avoid, const void *bvoid) -{ - const struct sortslot *aslot = avoid, *bslot = bvoid; - const js_Value *a = &aslot->v, *b = &bslot->v; - js_State *J = aslot->J; - const char *sx, *sy; - double v; - int c; - - int unx = (a->t.type == JS_TUNDEFINED); - int uny = (b->t.type == JS_TUNDEFINED); - if (unx) return !uny; - if (uny) return -1; - - if (js_iscallable(J, 1)) { - js_copy(J, 1); /* copy function */ - js_pushundefined(J); - js_pushvalue(J, *a); - js_pushvalue(J, *b); - js_call(J, 2); - v = js_tonumber(J, -1); - c = (v == 0) ? 0 : (v < 0) ? -1 : 1; - js_pop(J, 1); +static int Ap_sort_cmp(js_State *J, int idx_a, int idx_b) +{ + js_Object *obj = js_tovalue(J, 0)->u.object; + if (obj->u.a.simple) { + js_Value *val_a = &obj->u.a.array[idx_a]; + js_Value *val_b = &obj->u.a.array[idx_b]; + int und_a = val_a->t.type == JS_TUNDEFINED; + int und_b = val_b->t.type == JS_TUNDEFINED; + if (und_a) return und_b; + if (und_b) return -1; + if (js_iscallable(J, 1)) { + double v; + js_copy(J, 1); /* copy function */ + js_pushundefined(J); /* no 'this' binding */ + js_pushvalue(J, *val_a); + js_pushvalue(J, *val_b); + js_call(J, 2); + v = js_tonumber(J, -1); + js_pop(J, 1); + if (isnan(v)) + return 0; + if (v == 0) + return 0; + return v < 0 ? -1 : 1; + } else { + const char *str_a, *str_b; + int c; + js_pushvalue(J, *val_a); + js_pushvalue(J, *val_b); + str_a = js_tostring(J, -2); + str_b = js_tostring(J, -1); + c = strcmp(str_a, str_b); + js_pop(J, 2); + return c; + } } else { - js_pushvalue(J, *a); - js_pushvalue(J, *b); - sx = js_tostring(J, -2); - sy = js_tostring(J, -1); - c = strcmp(sx, sy); - js_pop(J, 2); + int und_a, und_b; + int has_a = js_hasindex(J, 0, idx_a); + int has_b = js_hasindex(J, 0, idx_b); + if (!has_a && !has_b) { + return 0; + } + if (has_a && !has_b) { + js_pop(J, 1); + return -1; + } + if (!has_a && has_b) { + js_pop(J, 1); + return 1; + } + + und_a = js_isundefined(J, -2); + und_b = js_isundefined(J, -1); + if (und_a) { + js_pop(J, 2); + return und_b; + } + if (und_b) { + js_pop(J, 2); + return -1; + } + + if (js_iscallable(J, 1)) { + double v; + js_copy(J, 1); /* copy function */ + js_pushundefined(J); /* no 'this' binding */ + js_copy(J, -4); + js_copy(J, -4); + js_call(J, 2); + v = js_tonumber(J, -1); + js_pop(J, 3); + if (isnan(v)) + return 0; + if (v == 0) + return 0; + return v < 0 ? -1 : 1; + } else { + const char *str_a = js_tostring(J, -2); + const char *str_b = js_tostring(J, -1); + int c = strcmp(str_a, str_b); + js_pop(J, 2); + return c; + } } - return c; } -static void Ap_sort(js_State *J) +static void Ap_sort_swap(js_State *J, int idx_a, int idx_b) { - struct sortslot * volatile array = NULL; - int i, n, len; - - len = js_getlength(J, 0); - if (len <= 0) { - js_copy(J, 0); - return; + js_Object *obj = js_tovalue(J, 0)->u.object; + if (obj->u.a.simple) { + js_Value tmp = obj->u.a.array[idx_a]; + obj->u.a.array[idx_a] = obj->u.a.array[idx_b]; + obj->u.a.array[idx_b] = tmp; + } else { + int has_a = js_hasindex(J, 0, idx_a); + int has_b = js_hasindex(J, 0, idx_b); + if (has_a && has_b) { + js_setindex(J, 0, idx_a); + js_setindex(J, 0, idx_b); + } else if (has_a && !has_b) { + js_delindex(J, 0, idx_a); + js_setindex(J, 0, idx_b); + } else if (!has_a && has_b) { + js_delindex(J, 0, idx_b); + js_setindex(J, 0, idx_a); + } } +} - if (len >= INT_MAX / (int)sizeof(*array)) - js_rangeerror(J, "array is too large to sort"); - - /* Holding objects where the GC cannot see them is illegal, but if we - * don't allow the GC to run we can use qsort() on a temporary array of - * js_Values for fast sorting. - */ - ++J->gcpause; +/* A bottom-up/bouncing heapsort implementation */ - if (js_try(J)) { - --J->gcpause; - js_free(J, array); - js_throw(J); +static int Ap_sort_leaf(js_State *J, int i, int end) +{ + int j = i; + int lc = (j << 1) + 1; /* left child */ + int rc = (j << 1) + 2; /* right child */ + while (rc < end) { + if (Ap_sort_cmp(J, rc, lc) > 0) + j = rc; + else + j = lc; + lc = (j << 1) + 1; + rc = (j << 1) + 2; } + if (lc < end) + j = lc; + return j; +} - array = js_malloc(J, len * sizeof *array); +static void Ap_sort_sift(js_State *J, int i, int end) +{ + int j = Ap_sort_leaf(J, i, end); + while (Ap_sort_cmp(J, i, j) > 0) + j = (j - 1) >> 1; /* parent */ + while (j > i) { + Ap_sort_swap(J, i, j); + j = (j - 1) >> 1; /* parent */ + } +} - n = 0; - for (i = 0; i < len; ++i) { - if (js_hasindex(J, 0, i)) { - array[n].v = *js_tovalue(J, -1); - array[n].J = J; - js_pop(J, 1); - ++n; - } +static void Ap_sort_heapsort(js_State *J, int n) +{ + int i; + for (i = n / 2 - 1; i >= 0; --i) + Ap_sort_sift(J, i, n); + for (i = n - 1; i > 0; --i) { + Ap_sort_swap(J, 0, i); + Ap_sort_sift(J, 0, i); } +} - qsort(array, n, sizeof *array, sortcmp); +static void Ap_sort(js_State *J) +{ + int len; - for (i = 0; i < n; ++i) { - js_pushvalue(J, array[i].v); - js_setindex(J, 0, i); - } - for (i = len-i; i >= n; --i) { - js_delindex(J, 0, i); + len = js_getlength(J, 0); + if (len <= 1) { + js_copy(J, 0); + return; } - --J->gcpause; + if (!js_iscallable(J, 1) && !js_isundefined(J, 1)) + js_typeerror(J, "comparison function must be a function or undefined"); - js_endtry(J); - js_free(J, array); + if (len >= INT_MAX) + js_rangeerror(J, "array is too large to sort"); + + Ap_sort_heapsort(J, len); js_copy(J, 0); } @@ -419,7 +500,7 @@ js_getproperty(J, 0, "join"); if (!js_iscallable(J, -1)) { js_pop(J, 1); - // TODO: call Object.prototype.toString implementation directly + /* TODO: call Object.prototype.toString implementation directly */ js_getglobal(J, "Object"); js_getproperty(J, -1, "prototype"); js_rot2pop1(J); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jserror.c new/mujs-1.3.7/jserror.c --- old/mujs-1.3.5/jserror.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jserror.c 2025-06-23 14:15:36.000000000 +0200 @@ -61,7 +61,7 @@ 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 @@ 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) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jsgc.c new/mujs-1.3.7/jsgc.c --- old/mujs-1.3.5/jsgc.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jsgc.c 2025-06-23 14:15:36.000000000 +0200 @@ -147,12 +147,6 @@ int mark; int i; - if (J->gcpause) { - if (report) - js_report(J, "garbage collector is paused"); - return; - } - mark = J->gcmark = J->gcmark == 1 ? 2 : 1; /* Add initial roots. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jsi.h new/mujs-1.3.7/jsi.h --- old/mujs-1.3.5/jsi.h 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jsi.h 2025-06-23 14:15:36.000000000 +0200 @@ -261,7 +261,6 @@ js_Value *stack; /* garbage collector list */ - int gcpause; int gcmark; unsigned int gccounter, gcthresh; js_Environment *gcenv; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jsobject.c new/mujs-1.3.7/jsobject.c --- old/mujs-1.3.5/jsobject.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jsobject.c 2025-06-23 14:15:36.000000000 +0200 @@ -126,7 +126,7 @@ obj = js_toobject(J, 1); ref = jsV_getproperty(J, obj, js_tostring(J, 2)); if (!ref) { - // TODO: builtin properties (string and array index and length, regexp flags, etc) + /* TODO: builtin properties (string and array index and length, regexp flags, etc) */ js_pushundefined(J); } else { js_newobject(J); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/jsstring.c new/mujs-1.3.7/jsstring.c --- old/mujs-1.3.5/jsstring.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/jsstring.c 2025-06-23 14:15:36.000000000 +0200 @@ -288,8 +288,10 @@ 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,27 +306,54 @@ 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) { - const char *s = checkstring(J, 0); + const char *s, *s0 = checkstring(J, 0); char * volatile dst = NULL; char *d; Rune rune; + const Rune *full; + int n; + + n = 1; + for (s = s0; *s;) { + s += chartorune(&rune, s); + full = tolowerrune_full(rune); + if (full) { + while (*full) { + n += runelen(*full); + ++full; + } + } else { + rune = tolowerrune(rune); + n += runelen(rune); + } + } if (js_try(J)) { js_free(J, dst); js_throw(J); } - d = dst = js_malloc(J, UTFmax * strlen(s) + 1); - while (*s) { + d = dst = js_malloc(J, n); + for (s = s0; *s;) { s += chartorune(&rune, s); - rune = tolowerrune(rune); - d += runetochar(d, &rune); + full = tolowerrune_full(rune); + if (full) { + while (*full) { + d += runetochar(d, full); + ++full; + } + } else { + rune = tolowerrune(rune); + d += runetochar(d, &rune); + } } *d = 0; @@ -335,21 +364,46 @@ static void Sp_toUpperCase(js_State *J) { - const char *s = checkstring(J, 0); + const char *s, *s0 = checkstring(J, 0); char * volatile dst = NULL; char *d; + const Rune *full; Rune rune; + int n; + + n = 1; + for (s = s0; *s;) { + s += chartorune(&rune, s); + full = toupperrune_full(rune); + if (full) { + while (*full) { + n += runelen(*full); + ++full; + } + } else { + rune = toupperrune(rune); + n += runelen(rune); + } + } if (js_try(J)) { js_free(J, dst); js_throw(J); } - d = dst = js_malloc(J, UTFmax * strlen(s) + 1); - while (*s) { + d = dst = js_malloc(J, n); + for (s = s0; *s;) { s += chartorune(&rune, s); - rune = toupperrune(rune); - d += runetochar(d, &rune); + full = toupperrune_full(rune); + if (full) { + while (*full) { + d += runetochar(d, full); + ++full; + } + } else { + rune = toupperrune(rune); + d += runetochar(d, &rune); + } } *d = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/main.c new/mujs-1.3.7/main.c --- old/mujs-1.3.5/main.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/main.c 2025-06-23 14:15:36.000000000 +0200 @@ -225,7 +225,7 @@ "Error.prototype.toString = function() {\n" "var s = this.name;\n" "if ('message' in this) s += ': ' + this.message;\n" - "if ('stackTrace' in this) s += this.stackTrace;\n" + "if ('stack' in this) s += this.stack;\n" "return s;\n" "};\n" ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/regexp.c new/mujs-1.3.7/regexp.c --- old/mujs-1.3.5/regexp.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/regexp.c 2025-06-23 14:15:36.000000000 +0200 @@ -147,7 +147,7 @@ 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 @@ g->yychar = '0'; return 1; } - return 0; + return 1; case 0: g->yychar = '0'; return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/tools/test262-harness.js new/mujs-1.3.7/tools/test262-harness.js --- old/mujs-1.3.5/tools/test262-harness.js 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/tools/test262-harness.js 2025-06-23 14:15:36.000000000 +0200 @@ -127,16 +127,16 @@ var msg = !neg_str ? err : "[Mismatch @negative " + neg_str + "]" + "\n " + err; info += (result.runtime ? "[run] " : "[load] ") + msg; - if (err && err.stackTrace && (result.runtime || full_mode)) { + if (err && err.stack && (result.runtime || full_mode)) { if (full_mode) { - info += err.stackTrace; + info += err.stack; } else { // trim the internal loader from the trace - var internal = err.stackTrace.indexOf("\n" + load("mujs_blahblah()").err.stackTrace.trim().split("\n")[1]); + var internal = err.stack.indexOf("\n" + load("mujs_blahblah()").err.stack.trim().split("\n")[1]); if (internal >= 0) - info += err.stackTrace.substring(0, internal); + info += err.stack.substring(0, internal); else - info += err.stackTrace; + info += err.stack; } } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/utf.c new/mujs-1.3.7/utf.c --- old/mujs-1.3.5/utf.c 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/utf.c 2025-06-23 14:15:36.000000000 +0200 @@ -283,3 +283,23 @@ return 1; return 0; } + +const Rune * +tolowerrune_full(Rune c) +{ + const Rune *p; + p = ucd_bsearch(c, ucd_tolower_full, nelem(ucd_tolower_full)/4, 4); + if(p && c == p[0]) + return p + 1; + return NULL; +} + +const Rune * +toupperrune_full(Rune c) +{ + const Rune *p; + p = ucd_bsearch(c, ucd_toupper_full, nelem(ucd_toupper_full)/5, 5); + if(p && c == p[0]) + return p + 1; + return NULL; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/utf.h new/mujs-1.3.7/utf.h --- old/mujs-1.3.5/utf.h 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/utf.h 2025-06-23 14:15:36.000000000 +0200 @@ -25,6 +25,8 @@ #define isupperrune jsU_isupperrune #define tolowerrune jsU_tolowerrune #define toupperrune jsU_toupperrune +#define tolowerrune_full jsU_tolowerrune_full +#define toupperrune_full jsU_toupperrune_full enum { @@ -44,5 +46,7 @@ int isupperrune(Rune c); Rune tolowerrune(Rune c); Rune toupperrune(Rune c); +const Rune* tolowerrune_full(Rune c); +const Rune* toupperrune_full(Rune c); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mujs-1.3.5/utfdata.h new/mujs-1.3.7/utfdata.h --- old/mujs-1.3.5/utfdata.h 2024-06-20 13:01:41.000000000 +0200 +++ new/mujs-1.3.7/utfdata.h 2025-06-23 14:15:36.000000000 +0200 @@ -171,7 +171,7 @@ 0x1c00,0x1c23, 0x1c4d,0x1c4f, 0x1c5a,0x1c7d, -0x1c80,0x1c88, +0x1c80,0x1c8a, 0x1c90,0x1cba, 0x1cbd,0x1cbf, 0x1ce9,0x1cec, @@ -236,9 +236,9 @@ 0xa6a0,0xa6e5, 0xa717,0xa71f, 0xa722,0xa788, -0xa78b,0xa7ca, +0xa78b,0xa7cd, 0xa7d0,0xa7d1, -0xa7d5,0xa7d9, +0xa7d5,0xa7dc, 0xa7f2,0xa801, 0xa803,0xa805, 0xa807,0xa80a, @@ -326,6 +326,7 @@ 0x105a3,0x105b1, 0x105b3,0x105b9, 0x105bb,0x105bc, +0x105c0,0x105f3, 0x10600,0x10736, 0x10740,0x10755, 0x10760,0x10767, @@ -359,8 +360,11 @@ 0x10c80,0x10cb2, 0x10cc0,0x10cf2, 0x10d00,0x10d23, +0x10d4a,0x10d65, +0x10d6f,0x10d85, 0x10e80,0x10ea9, 0x10eb0,0x10eb1, +0x10ec2,0x10ec4, 0x10f00,0x10f1c, 0x10f30,0x10f45, 0x10f70,0x10f81, @@ -389,6 +393,8 @@ 0x11332,0x11333, 0x11335,0x11339, 0x1135d,0x11361, +0x11380,0x11389, +0x11390,0x113b5, 0x11400,0x11434, 0x11447,0x1144a, 0x1145f,0x11461, @@ -411,6 +417,7 @@ 0x11a0b,0x11a32, 0x11a5c,0x11a89, 0x11ab0,0x11af8, +0x11bc0,0x11be0, 0x11c00,0x11c08, 0x11c0a,0x11c2e, 0x11c72,0x11c8f, @@ -428,7 +435,9 @@ 0x12f90,0x12ff0, 0x13000,0x1342f, 0x13441,0x13446, +0x13460,0x143fa, 0x14400,0x14646, +0x16100,0x1611d, 0x16800,0x16a38, 0x16a40,0x16a5e, 0x16a70,0x16abe, @@ -437,11 +446,13 @@ 0x16b40,0x16b43, 0x16b63,0x16b77, 0x16b7d,0x16b8f, +0x16d40,0x16d6c, 0x16e40,0x16e7f, 0x16f00,0x16f4a, 0x16f93,0x16f9f, 0x16fe0,0x16fe1, 0x18800,0x18cd5, +0x18cff,0x18d00, 0x1aff0,0x1aff3, 0x1aff5,0x1affb, 0x1affd,0x1affe, @@ -488,6 +499,7 @@ 0x1e290,0x1e2ad, 0x1e2c0,0x1e2eb, 0x1e4d0,0x1e4eb, +0x1e5d0,0x1e5ed, 0x1e7e0,0x1e7e6, 0x1e7e8,0x1e7eb, 0x1e7ed,0x1e7ee, @@ -615,6 +627,11 @@ 0x11288, 0x1133d, 0x11350, +0x1138b, +0x1138e, +0x113b7, +0x113d1, +0x113d3, 0x114c7, 0x11644, 0x116b8, @@ -636,7 +653,6 @@ 0x16fe3, 0x17000, 0x187f7, -0x18d00, 0x18d08, 0x1b132, 0x1b155, @@ -644,6 +660,7 @@ 0x1d4bb, 0x1d546, 0x1e14e, +0x1e5f0, 0x1e94b, 0x1ee24, 0x1ee27, @@ -671,6 +688,8 @@ 0x2cea1, 0x2ceb0, 0x2ebe0, +0x2ebf0, +0x2ee5d, 0x30000, 0x3134a, 0x31350, @@ -726,6 +745,7 @@ 0x1058c,0x10592,39, 0x10594,0x10595,39, 0x10c80,0x10cb2,64, +0x10d50,0x10d65,32, 0x118a0,0x118bf,32, 0x16e40,0x16e5f,32, 0x1e900,0x1e921,34, @@ -1023,6 +1043,7 @@ 0x52e,1, 0x10c7,7264, 0x10cd,7264, +0x1c89,1, 0x1e00,1, 0x1e02,1, 0x1e04,1, @@ -1345,9 +1366,13 @@ 0xa7c6,-35384, 0xa7c7,1, 0xa7c9,1, +0xa7cb,-42343, +0xa7cc,1, 0xa7d0,1, 0xa7d6,1, 0xa7d8,1, +0xa7da,1, +0xa7dc,-42561, 0xa7f5,1, }; @@ -1401,6 +1426,7 @@ 0x105b3,0x105b9,-39, 0x105bb,0x105bc,-39, 0x10cc0,0x10cf2,-64, +0x10d70,0x10d85,-32, 0x118c0,0x118df,-32, 0x16e60,0x16e7f,-32, 0x1e922,0x1e943,-34, @@ -1481,6 +1507,7 @@ 0x195,97, 0x199,-1, 0x19a,163, +0x19b,42561, 0x19e,130, 0x1a1,-1, 0x1a3,-1, @@ -1567,6 +1594,7 @@ 0x260,-205, 0x261,42315, 0x263,-207, +0x264,42343, 0x265,42280, 0x266,42308, 0x268,-209, @@ -1727,6 +1755,7 @@ 0x1c86,-6236, 0x1c87,-6181, 0x1c88,35266, +0x1c8a,-1, 0x1d79,35332, 0x1d7d,3814, 0x1d8e,35384, @@ -2034,9 +2063,147 @@ 0xa7c3,-1, 0xa7c8,-1, 0xa7ca,-1, +0xa7cd,-1, 0xa7d1,-1, 0xa7d7,-1, 0xa7d9,-1, +0xa7db,-1, 0xa7f6,-1, 0xab53,-928, }; + +static const Rune ucd_tolower_full[] = { +0x130,0x69,0x307,0x0, +0x1f88,0x1f80,0x0,0x0, +0x1f89,0x1f81,0x0,0x0, +0x1f8a,0x1f82,0x0,0x0, +0x1f8b,0x1f83,0x0,0x0, +0x1f8c,0x1f84,0x0,0x0, +0x1f8d,0x1f85,0x0,0x0, +0x1f8e,0x1f86,0x0,0x0, +0x1f8f,0x1f87,0x0,0x0, +0x1f98,0x1f90,0x0,0x0, +0x1f99,0x1f91,0x0,0x0, +0x1f9a,0x1f92,0x0,0x0, +0x1f9b,0x1f93,0x0,0x0, +0x1f9c,0x1f94,0x0,0x0, +0x1f9d,0x1f95,0x0,0x0, +0x1f9e,0x1f96,0x0,0x0, +0x1f9f,0x1f97,0x0,0x0, +0x1fa8,0x1fa0,0x0,0x0, +0x1fa9,0x1fa1,0x0,0x0, +0x1faa,0x1fa2,0x0,0x0, +0x1fab,0x1fa3,0x0,0x0, +0x1fac,0x1fa4,0x0,0x0, +0x1fad,0x1fa5,0x0,0x0, +0x1fae,0x1fa6,0x0,0x0, +0x1faf,0x1fa7,0x0,0x0, +0x1fbc,0x1fb3,0x0,0x0, +0x1fcc,0x1fc3,0x0,0x0, +0x1ffc,0x1ff3,0x0,0x0, +}; + +static const Rune ucd_toupper_full[] = { +0xdf,0x53,0x53,0x0,0x0, +0x149,0x2bc,0x4e,0x0,0x0, +0x1f0,0x4a,0x30c,0x0,0x0, +0x390,0x399,0x308,0x301,0x0, +0x3b0,0x3a5,0x308,0x301,0x0, +0x587,0x535,0x552,0x0,0x0, +0x1e96,0x48,0x331,0x0,0x0, +0x1e97,0x54,0x308,0x0,0x0, +0x1e98,0x57,0x30a,0x0,0x0, +0x1e99,0x59,0x30a,0x0,0x0, +0x1e9a,0x41,0x2be,0x0,0x0, +0x1f50,0x3a5,0x313,0x0,0x0, +0x1f52,0x3a5,0x313,0x300,0x0, +0x1f54,0x3a5,0x313,0x301,0x0, +0x1f56,0x3a5,0x313,0x342,0x0, +0x1f80,0x1f08,0x399,0x0,0x0, +0x1f81,0x1f09,0x399,0x0,0x0, +0x1f82,0x1f0a,0x399,0x0,0x0, +0x1f83,0x1f0b,0x399,0x0,0x0, +0x1f84,0x1f0c,0x399,0x0,0x0, +0x1f85,0x1f0d,0x399,0x0,0x0, +0x1f86,0x1f0e,0x399,0x0,0x0, +0x1f87,0x1f0f,0x399,0x0,0x0, +0x1f88,0x1f08,0x399,0x0,0x0, +0x1f89,0x1f09,0x399,0x0,0x0, +0x1f8a,0x1f0a,0x399,0x0,0x0, +0x1f8b,0x1f0b,0x399,0x0,0x0, +0x1f8c,0x1f0c,0x399,0x0,0x0, +0x1f8d,0x1f0d,0x399,0x0,0x0, +0x1f8e,0x1f0e,0x399,0x0,0x0, +0x1f8f,0x1f0f,0x399,0x0,0x0, +0x1f90,0x1f28,0x399,0x0,0x0, +0x1f91,0x1f29,0x399,0x0,0x0, +0x1f92,0x1f2a,0x399,0x0,0x0, +0x1f93,0x1f2b,0x399,0x0,0x0, +0x1f94,0x1f2c,0x399,0x0,0x0, +0x1f95,0x1f2d,0x399,0x0,0x0, +0x1f96,0x1f2e,0x399,0x0,0x0, +0x1f97,0x1f2f,0x399,0x0,0x0, +0x1f98,0x1f28,0x399,0x0,0x0, +0x1f99,0x1f29,0x399,0x0,0x0, +0x1f9a,0x1f2a,0x399,0x0,0x0, +0x1f9b,0x1f2b,0x399,0x0,0x0, +0x1f9c,0x1f2c,0x399,0x0,0x0, +0x1f9d,0x1f2d,0x399,0x0,0x0, +0x1f9e,0x1f2e,0x399,0x0,0x0, +0x1f9f,0x1f2f,0x399,0x0,0x0, +0x1fa0,0x1f68,0x399,0x0,0x0, +0x1fa1,0x1f69,0x399,0x0,0x0, +0x1fa2,0x1f6a,0x399,0x0,0x0, +0x1fa3,0x1f6b,0x399,0x0,0x0, +0x1fa4,0x1f6c,0x399,0x0,0x0, +0x1fa5,0x1f6d,0x399,0x0,0x0, +0x1fa6,0x1f6e,0x399,0x0,0x0, +0x1fa7,0x1f6f,0x399,0x0,0x0, +0x1fa8,0x1f68,0x399,0x0,0x0, +0x1fa9,0x1f69,0x399,0x0,0x0, +0x1faa,0x1f6a,0x399,0x0,0x0, +0x1fab,0x1f6b,0x399,0x0,0x0, +0x1fac,0x1f6c,0x399,0x0,0x0, +0x1fad,0x1f6d,0x399,0x0,0x0, +0x1fae,0x1f6e,0x399,0x0,0x0, +0x1faf,0x1f6f,0x399,0x0,0x0, +0x1fb2,0x1fba,0x399,0x0,0x0, +0x1fb3,0x391,0x399,0x0,0x0, +0x1fb4,0x386,0x399,0x0,0x0, +0x1fb6,0x391,0x342,0x0,0x0, +0x1fb7,0x391,0x342,0x399,0x0, +0x1fbc,0x391,0x399,0x0,0x0, +0x1fc2,0x1fca,0x399,0x0,0x0, +0x1fc3,0x397,0x399,0x0,0x0, +0x1fc4,0x389,0x399,0x0,0x0, +0x1fc6,0x397,0x342,0x0,0x0, +0x1fc7,0x397,0x342,0x399,0x0, +0x1fcc,0x397,0x399,0x0,0x0, +0x1fd2,0x399,0x308,0x300,0x0, +0x1fd3,0x399,0x308,0x301,0x0, +0x1fd6,0x399,0x342,0x0,0x0, +0x1fd7,0x399,0x308,0x342,0x0, +0x1fe2,0x3a5,0x308,0x300,0x0, +0x1fe3,0x3a5,0x308,0x301,0x0, +0x1fe4,0x3a1,0x313,0x0,0x0, +0x1fe6,0x3a5,0x342,0x0,0x0, +0x1fe7,0x3a5,0x308,0x342,0x0, +0x1ff2,0x1ffa,0x399,0x0,0x0, +0x1ff3,0x3a9,0x399,0x0,0x0, +0x1ff4,0x38f,0x399,0x0,0x0, +0x1ff6,0x3a9,0x342,0x0,0x0, +0x1ff7,0x3a9,0x342,0x399,0x0, +0x1ffc,0x3a9,0x399,0x0,0x0, +0xfb00,0x46,0x46,0x0,0x0, +0xfb01,0x46,0x49,0x0,0x0, +0xfb02,0x46,0x4c,0x0,0x0, +0xfb03,0x46,0x46,0x49,0x0, +0xfb04,0x46,0x46,0x4c,0x0, +0xfb05,0x53,0x54,0x0,0x0, +0xfb06,0x53,0x54,0x0,0x0, +0xfb13,0x544,0x546,0x0,0x0, +0xfb14,0x544,0x535,0x0,0x0, +0xfb15,0x544,0x53b,0x0,0x0, +0xfb16,0x54e,0x546,0x0,0x0, +0xfb17,0x544,0x53d,0x0,0x0, +};
