Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mujs for openSUSE:Factory checked in 
at 2021-04-15 16:57:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mujs (Old)
 and      /work/SRC/openSUSE:Factory/.mujs.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mujs"

Thu Apr 15 16:57:50 2021 rev:2 rq:885484 version:1.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/mujs/mujs.changes        2021-03-12 
13:33:21.766329458 +0100
+++ /work/SRC/openSUSE:Factory/.mujs.new.12324/mujs.changes     2021-04-15 
16:58:32.782781490 +0200
@@ -1,0 +2,21 @@
+Wed Apr 14 22:08:53 UTC 2021 - Ferdinand Thiessen <r...@fthiessen.de>
+
+- Update mujs 1.1.1
+  * Fix: Always create new scope for eval()
+  * Don't redefine/reset existing vars in script code
+  * Fix: RegExp.prototype should be a regular expression object
+  * Throw when redefining non-configurable/readonly properties
+  * Array:  Fix crash when length is negative
+  * fix split doesn't convert context to string if no argument is passed
+  * Parse integers with floats to support large numbers.
+  * Optimize array construction bytecode.
+  * Fix: Expose type of value as an enum with js_type()
+  * Fixed js_strtol: Prevent negative table indexing in
+- Update mujs 1.1.0
+  * Don't allow creating new properties on transient objects.
+  * Fixed escape characters in regex parser
+  * Handle NaN in Date accessors
+  * Handle undefined argument to Error constructor
+- Fixed RPM error because of missing RPM group
+
+-------------------------------------------------------------------

Old:
----
  mujs-1.0.9.tar.xz

New:
----
  mujs-1.1.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mujs.spec ++++++
--- /var/tmp/diff_new_pack.mSTFmx/_old  2021-04-15 16:58:33.202782155 +0200
+++ /var/tmp/diff_new_pack.mSTFmx/_new  2021-04-15 16:58:33.202782155 +0200
@@ -17,12 +17,13 @@
 
 
 Name:           mujs
-Version:        1.0.9
+Version:        1.1.1
 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/mujs-1.0.9.tar.xz
+Source0:        https://mujs.com/downloads/%{name}-%{version}.tar.xz
 BuildRequires:  coreutils
 BuildRequires:  gcc
 BuildRequires:  grep
@@ -34,6 +35,7 @@
 
 %package devel
 Summary:        MuJS development files
+Group:          Development/Languages/C and C++
 Provides:       %{name}-static = %{version}
 
 %description devel

++++++ mujs-1.0.9.tar.xz -> mujs-1.1.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/.gitignore new/mujs-1.1.1/.gitignore
--- old/mujs-1.0.9/.gitignore   2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/.gitignore   2021-04-13 04:22:04.000000000 +0200
@@ -1,4 +1,12 @@
-build
-tags
+# Optional testsuites
 tests
 specs
+
+# Generated files:
+build
+tags
+
+# Editor settings:
+user.make
+.exrc
+.vimrc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/Makefile new/mujs-1.1.1/Makefile
--- old/mujs-1.0.9/Makefile     2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/Makefile     2021-04-13 04:22:04.000000000 +0200
@@ -1,5 +1,7 @@
 # Build type and install directories:
 
+-include user.make
+
 build ?= release
 
 prefix ?= /usr/local
@@ -30,8 +32,8 @@
 else ifeq "$(build)" "sanitize"
   CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
   LDFLAGS += -fsanitize=address
-else
-  CFLAGS += -Os
+else ifeq "$(build)" "release"
+  CFLAGS += -O2
   LDFLAGS += -Wl,-s
 endif
 
@@ -41,6 +43,7 @@
 endif
 
 CFLAGS += $(XCFLAGS)
+CPPFLAGS += $(XCPPFLAGS)
 
 # You shouldn't need to edit anything below here.
 
@@ -67,11 +70,11 @@
 
 $(OUT)/%.o: %.c $(HDRS)
        @ mkdir -p $(dir $@)
-       $(CC) $(CFLAGS) -o $@ -c $<
+       $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
 
 $(OUT)/libmujs.o: one.c $(HDRS)
        @ mkdir -p $(dir $@)
-       $(CC) $(CFLAGS) -o $@ -c $<
+       $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
 
 $(OUT)/libmujs.a: $(OUT)/libmujs.o
        @ mkdir -p $(dir $@)
@@ -79,7 +82,7 @@
 
 $(OUT)/libmujs.so: one.c $(HDRS)
        @ mkdir -p $(dir $@)
-       $(CC) $(CFLAGS) -fPIC -shared -o $@ $< -lm
+       $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $< -lm
 
 $(OUT)/mujs: $(OUT)/libmujs.o $(OUT)/main.o
        @ mkdir -p $(dir $@)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsarray.c new/mujs-1.1.1/jsarray.c
--- old/mujs-1.0.9/jsarray.c    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsarray.c    2021-04-13 04:22:04.000000000 +0200
@@ -103,7 +103,7 @@
                seplen = 1;
        }
 
-       if (len == 0) {
+       if (len <= 0) {
                js_pushliteral(J, "");
                return;
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsbuiltin.c new/mujs-1.1.1/jsbuiltin.c
--- old/mujs-1.0.9/jsbuiltin.c  2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsbuiltin.c  2021-04-13 04:22:04.000000000 +0200
@@ -3,6 +3,7 @@
 #include "jscompile.h"
 #include "jsvalue.h"
 #include "jsbuiltin.h"
+#include "regexp.h"
 
 static void jsB_globalf(js_State *J, const char *name, js_CFunction cfun, int 
n)
 {
@@ -33,7 +34,7 @@
 static void jsB_parseInt(js_State *J)
 {
        const char *s = js_tostring(J, 1);
-       int radix = js_isdefined(J, 2) ? js_tointeger(J, 2) : 10;
+       int radix = js_isdefined(J, 2) ? js_tointeger(J, 2) : 0;
        double sign = 1;
        double n;
        char *e;
@@ -56,7 +57,7 @@
                js_pushnumber(J, NAN);
                return;
        }
-       n = strtol(s, &e, radix);
+       n = js_strtol(s, &e, radix);
        if (s == e)
                js_pushnumber(J, NAN);
        else
@@ -166,7 +167,7 @@
 #define URIRESERVED ";/?:@&=+$,"
 #define URIALPHA "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
 #define URIDIGIT "0123456789"
-#define URIMARK "-_.!~*`()"
+#define URIMARK "-_.!~*'()"
 #define URIUNESCAPED URIALPHA URIDIGIT URIMARK
 
 static void jsB_decodeURI(js_State *J)
@@ -198,9 +199,12 @@
        J->Boolean_prototype = jsV_newobject(J, JS_CBOOLEAN, 
J->Object_prototype);
        J->Number_prototype = jsV_newobject(J, JS_CNUMBER, J->Object_prototype);
        J->String_prototype = jsV_newobject(J, JS_CSTRING, J->Object_prototype);
-       J->RegExp_prototype = jsV_newobject(J, JS_COBJECT, J->Object_prototype);
        J->Date_prototype = jsV_newobject(J, JS_CDATE, J->Object_prototype);
 
+       J->RegExp_prototype = jsV_newobject(J, JS_CREGEXP, J->Object_prototype);
+       J->RegExp_prototype->u.r.prog = js_regcompx(J->alloc, J->actx, "(?:)", 
0, NULL);
+       J->RegExp_prototype->u.r.source = js_strdup(J, "(?:)");
+
        /* All the native error types */
        J->Error_prototype = jsV_newobject(J, JS_CERROR, J->Object_prototype);
        J->EvalError_prototype = jsV_newobject(J, JS_CERROR, 
J->Error_prototype);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jscompile.c new/mujs-1.1.1/jscompile.c
--- old/mujs-1.0.9/jscompile.c  2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jscompile.c  2021-04-13 04:22:04.000000000 +0200
@@ -110,34 +110,6 @@
        return F->funlen++;
 }
 
-static int addnumber(JF, double value)
-{
-       int i;
-       for (i = 0; i < F->numlen; ++i)
-               if (F->numtab[i] == value)
-                       return i;
-       if (F->numlen >= F->numcap) {
-               F->numcap = F->numcap ? F->numcap * 2 : 16;
-               F->numtab = js_realloc(J, F->numtab, F->numcap * sizeof 
*F->numtab);
-       }
-       F->numtab[F->numlen] = value;
-       return F->numlen++;
-}
-
-static int addstring(JF, const char *value)
-{
-       int i;
-       for (i = 0; i < F->strlen; ++i)
-               if (!strcmp(F->strtab[i], value))
-                       return i;
-       if (F->strlen >= F->strcap) {
-               F->strcap = F->strcap ? F->strcap * 2 : 16;
-               F->strtab = js_realloc(J, F->strtab, F->strcap * sizeof 
*F->strtab);
-       }
-       F->strtab[F->strlen] = value;
-       return F->strlen++;
-}
-
 static int addlocal(JF, js_Ast *ident, int reuse)
 {
        const char *name = ident->string;
@@ -196,15 +168,27 @@
                emit(J, F, OP_INTEGER);
                emitarg(J, F, num + 32768);
        } else {
+#define N (sizeof(num) / sizeof(js_Instruction))
+               js_Instruction x[N];
+               size_t i;
                emit(J, F, OP_NUMBER);
-               emitarg(J, F, addnumber(J, F, num));
+               memcpy(x, &num, sizeof(num));
+               for (i = 0; i < N; ++i)
+                       emitarg(J, F, x[i]);
+#undef N
        }
 }
 
 static void emitstring(JF, int opcode, const char *str)
 {
+#define N (sizeof(str) / sizeof(js_Instruction))
+       js_Instruction x[N];
+       size_t i;
        emit(J, F, opcode);
-       emitarg(J, F, addstring(J, F, str));
+       memcpy(x, &str, sizeof(str));
+       for (i = 0; i < N; ++i)
+               emitarg(J, F, x[i]);
+#undef N
 }
 
 static void emitlocal(JF, int oploc, int opvar, js_Ast *ident)
@@ -302,17 +286,10 @@
 
 static void carray(JF, js_Ast *list)
 {
-       int i = 0;
        while (list) {
-               if (list->a->type != EXP_UNDEF) {
-                       emitline(J, F, list->a);
-                       emitnumber(J, F, i++);
-                       cexp(J, F, list->a);
-                       emitline(J, F, list->a);
-                       emit(J, F, OP_INITPROP);
-               } else {
-                       ++i;
-               }
+               emitline(J, F, list->a);
+               cexp(J, F, list->a);
+               emit(J, F, OP_INITARRAY);
                list = list->b;
        }
 }
@@ -630,8 +607,7 @@
 
        case EXP_REGEXP:
                emitline(J, F, exp);
-               emit(J, F, OP_NEWREGEXP);
-               emitarg(J, F, addstring(J, F, exp->string));
+               emitstring(J, F, OP_NEWREGEXP, exp->string);
                emitarg(J, F, exp->number);
                break;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jscompile.h new/mujs-1.1.1/jscompile.h
--- old/mujs-1.0.9/jscompile.h  2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jscompile.h  2021-04-13 04:22:04.000000000 +0200
@@ -38,6 +38,7 @@
 
        OP_IN,          /* <name> <obj> -- <exists?> */
 
+       OP_INITARRAY,   /* <obj> <val> -- <obj> */
        OP_INITPROP,    /* <obj> <key> <val> -- <obj> */
        OP_INITGETTER,  /* <obj> <key> <closure> -- <obj> */
        OP_INITSETTER,  /* <obj> <key> <closure> -- <obj> */
@@ -122,12 +123,6 @@
        js_Function **funtab;
        int funcap, funlen;
 
-       double *numtab;
-       int numcap, numlen;
-
-       const char **strtab;
-       int strcap, strlen;
-
        const char **vartab;
        int varcap, varlen;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsdate.c new/mujs-1.1.1/jsdate.c
--- old/mujs-1.0.9/jsdate.c     2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsdate.c     2021-04-13 04:22:04.000000000 +0200
@@ -491,103 +491,154 @@
 static void Dp_getFullYear(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, YearFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, YearFromTime(LocalTime(t)));
 }
 
 static void Dp_getMonth(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, MonthFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, MonthFromTime(LocalTime(t)));
 }
 
 static void Dp_getDate(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, DateFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, DateFromTime(LocalTime(t)));
 }
 
 static void Dp_getDay(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, WeekDay(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, WeekDay(LocalTime(t)));
 }
 
 static void Dp_getHours(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, HourFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, HourFromTime(LocalTime(t)));
 }
 
 static void Dp_getMinutes(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, MinFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, MinFromTime(LocalTime(t)));
 }
 
 static void Dp_getSeconds(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, SecFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, SecFromTime(LocalTime(t)));
 }
 
 static void Dp_getMilliseconds(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, msFromTime(LocalTime(t)));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, msFromTime(LocalTime(t)));
 }
 
 static void Dp_getUTCFullYear(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, YearFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, YearFromTime(t));
 }
 
 static void Dp_getUTCMonth(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, MonthFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, MonthFromTime(t));
 }
 
 static void Dp_getUTCDate(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, DateFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, DateFromTime(t));
 }
 
 static void Dp_getUTCDay(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, WeekDay(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, WeekDay(t));
 }
 
 static void Dp_getUTCHours(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, HourFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, HourFromTime(t));
 }
 
 static void Dp_getUTCMinutes(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, MinFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, MinFromTime(t));
 }
 
 static void Dp_getUTCSeconds(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, SecFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, SecFromTime(t));
 }
 
 static void Dp_getUTCMilliseconds(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, msFromTime(t));
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, msFromTime(t));
 }
 
 static void Dp_getTimezoneOffset(js_State *J)
 {
        double t = js_todate(J, 0);
-       js_pushnumber(J, (t - LocalTime(t)) / msPerMinute);
+       if (isnan(t))
+               js_pushnumber(J, NAN);
+       else
+               js_pushnumber(J, (t - LocalTime(t)) / msPerMinute);
 }
 
 static void Dp_setTime(js_State *J)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsdump.c new/mujs-1.1.1/jsdump.c
--- old/mujs-1.0.9/jsdump.c     2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsdump.c     2021-04-13 04:22:04.000000000 +0200
@@ -286,7 +286,12 @@
 static void pregexp(const char *prog, int flags)
 {
        pc('/');
-       ps(prog);
+       while (*prog) {
+               if (*prog == '/')
+                       pc('\\');
+               pc(*prog);
+               ++prog;
+       }
        pc('/');
        if (flags & JS_REGEXP_G) pc('g');
        if (flags & JS_REGEXP_I) pc('i');
@@ -776,6 +781,8 @@
 {
        js_Instruction *p = F->code;
        js_Instruction *end = F->code + F->codelen;
+       char *s;
+       double n;
        int i;
 
        minify = 0;
@@ -802,16 +809,21 @@
                        printf(" %ld", (long)((*p++) - 32768));
                        break;
                case OP_NUMBER:
-                       printf(" %.9g", F->numtab[*p++]);
+                       memcpy(&n, p, sizeof(n));
+                       p += sizeof(n) / sizeof(*p);
+                       printf(" %.9g", n);
                        break;
                case OP_STRING:
+                       memcpy(&s, p, sizeof(s));
+                       p += sizeof(s) / sizeof(*p);
                        pc(' ');
-                       pstr(F->strtab[*p++]);
+                       pstr(s);
                        break;
                case OP_NEWREGEXP:
                        pc(' ');
-                       pregexp(F->strtab[p[0]], p[1]);
-                       p += 2;
+                       memcpy(&s, p, sizeof(s));
+                       p += sizeof(s) / sizeof(*p);
+                       pregexp(s, *p++);
                        break;
 
                case OP_GETVAR:
@@ -822,8 +834,10 @@
                case OP_SETPROP_S:
                case OP_DELPROP_S:
                case OP_CATCH:
+                       memcpy(&s, p, sizeof(s));
+                       p += sizeof(s) / sizeof(*p);
                        pc(' ');
-                       ps(F->strtab[*p++]);
+                       ps(s);
                        break;
 
                case OP_GETLOCAL:
@@ -885,7 +899,6 @@
                                v.u.object->u.f.function->line);
                        break;
                case JS_CSCRIPT: printf("[Script %s]", 
v.u.object->u.f.function->filename); break;
-               case JS_CEVAL: printf("[Eval %s]", 
v.u.object->u.f.function->filename); break;
                case JS_CCFUNCTION: printf("[CFunction %s]", 
v.u.object->u.c.name); break;
                case JS_CBOOLEAN: printf("[Boolean %d]", 
v.u.object->u.boolean); break;
                case JS_CNUMBER: printf("[Number %g]", v.u.object->u.number); 
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jserror.c new/mujs-1.1.1/jserror.c
--- old/mujs-1.0.9/jserror.c    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jserror.c    2021-04-13 04:22:04.000000000 +0200
@@ -57,9 +57,8 @@
 
 static int jsB_ErrorX(js_State *J, js_Object *prototype)
 {
-       int top = js_gettop(J);
        js_pushobject(J, jsV_newobject(J, JS_CERROR, prototype));
-       if (top > 1) {
+       if (js_isdefined(J, 1)) {
                js_pushstring(J, js_tostring(J, 1));
                js_defproperty(J, -2, "message", JS_DONTENUM);
        }
@@ -109,7 +108,6 @@
        js_pushobject(J, J->Error_prototype);
        {
                        jsB_props(J, "name", "Error");
-                       jsB_props(J, "message", "an error has occurred");
                        jsB_propf(J, "Error.prototype.toString", Ep_toString, 
0);
        }
        js_newcconstructor(J, jsB_Error, jsB_Error, "Error", 1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsfunction.c new/mujs-1.1.1/jsfunction.c
--- old/mujs-1.0.9/jsfunction.c 2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsfunction.c 2021-04-13 04:22:04.000000000 +0200
@@ -56,7 +56,7 @@
        if (!js_iscallable(J, 0))
                js_typeerror(J, "not a function");
 
-       if (self->type == JS_CFUNCTION || self->type == JS_CSCRIPT || 
self->type == JS_CEVAL) {
+       if (self->type == JS_CFUNCTION || self->type == JS_CSCRIPT) {
                js_Function *F = self->u.f.function;
 
                if (js_try(J)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsgc.c new/mujs-1.1.1/jsgc.c
--- old/mujs-1.0.9/jsgc.c       2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsgc.c       2021-04-13 04:22:04.000000000 +0200
@@ -13,8 +13,6 @@
 static void jsG_freefunction(js_State *J, js_Function *fun)
 {
        js_free(J, fun->funtab);
-       js_free(J, fun->numtab);
-       js_free(J, fun->strtab);
        js_free(J, fun->vartab);
        js_free(J, fun->code);
        js_free(J, fun);
@@ -103,7 +101,7 @@
        if (obj->type == JS_CITERATOR && obj->u.iter.target->gcmark != mark) {
                jsG_markobject(J, mark, obj->u.iter.target);
        }
-       if (obj->type == JS_CFUNCTION || obj->type == JS_CSCRIPT || obj->type 
== JS_CEVAL) {
+       if (obj->type == JS_CFUNCTION || obj->type == JS_CSCRIPT) {
                if (obj->u.f.scope && obj->u.f.scope->gcmark != mark)
                        jsG_markenvironment(J, mark, obj->u.f.scope);
                if (obj->u.f.function && obj->u.f.function->gcmark != mark)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsi.h new/mujs-1.1.1/jsi.h
--- old/mujs-1.0.9/jsi.h        2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsi.h        2021-04-13 04:22:04.000000000 +0200
@@ -114,11 +114,13 @@
 int js_grisu2(double v, char *buffer, int *K);
 double js_strtod(const char *as, char **aas);
 
+double js_strtol(const char *s, char **ep, int radix);
+
 /* Private stack functions */
 
 void js_newarguments(js_State *J);
 void js_newfunction(js_State *J, js_Function *function, js_Environment *scope);
-void js_newscript(js_State *J, js_Function *fun, js_Environment *scope, int 
type);
+void js_newscript(js_State *J, js_Function *function, js_Environment *scope);
 void js_loadeval(js_State *J, const char *filename, const char *source);
 
 js_Regexp *js_toregexp(js_State *J, int idx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsobject.c new/mujs-1.1.1/jsobject.c
--- old/mujs-1.0.9/jsobject.c   2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsobject.c   2021-04-13 04:22:04.000000000 +0200
@@ -31,7 +31,6 @@
                case JS_CARRAY: js_pushliteral(J, "[object Array]"); break;
                case JS_CFUNCTION: js_pushliteral(J, "[object Function]"); 
break;
                case JS_CSCRIPT: js_pushliteral(J, "[object Function]"); break;
-               case JS_CEVAL: js_pushliteral(J, "[object Function]"); break;
                case JS_CCFUNCTION: js_pushliteral(J, "[object Function]"); 
break;
                case JS_CERROR: js_pushliteral(J, "[object Error]"); break;
                case JS_CBOOLEAN: js_pushliteral(J, "[object Boolean]"); break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsregexp.c new/mujs-1.1.1/jsregexp.c
--- old/mujs-1.0.9/jsregexp.c   2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsregexp.c   2021-04-13 04:22:04.000000000 +0200
@@ -3,7 +3,26 @@
 #include "jsbuiltin.h"
 #include "regexp.h"
 
-void js_newregexp(js_State *J, const char *pattern, int flags)
+static char *escaperegexp(js_State *J, const char *pattern) {
+       char *copy, *p;
+       const char *s;
+       int n = 0;
+       for (s = pattern; *s; ++s) {
+               if (*s == '/')
+                       ++n;
+               ++n;
+       }
+       copy = p = js_malloc(J, n+1);
+       for (s = pattern; *s; ++s) {
+               if (*s == '/')
+                       *p++ = '\\';
+               *p++ = *s;
+       }
+       *p = 0;
+       return copy;
+}
+
+static void js_newregexpx(js_State *J, const char *pattern, int flags, int 
is_clone)
 {
        const char *error;
        js_Object *obj;
@@ -21,12 +40,17 @@
                js_syntaxerror(J, "regular expression: %s", error);
 
        obj->u.r.prog = prog;
-       obj->u.r.source = js_strdup(J, pattern);
+       obj->u.r.source = is_clone ? js_strdup(J, pattern) : escaperegexp(J, 
pattern);
        obj->u.r.flags = flags;
        obj->u.r.last = 0;
        js_pushobject(J, obj);
 }
 
+void js_newregexp(js_State *J, const char *pattern, int flags)
+{
+       js_newregexpx(J, pattern, flags, 0);
+}
+
 void js_RegExp_prototype_exec(js_State *J, js_Regexp *re, const char *text)
 {
        int result;
@@ -116,6 +140,7 @@
        js_Regexp *old;
        const char *pattern;
        int flags;
+       int is_clone = 0;
 
        if (js_isregexp(J, 1)) {
                if (js_isdefined(J, 2))
@@ -123,6 +148,7 @@
                old = js_toregexp(J, 1);
                pattern = old->source;
                flags = old->flags;
+               is_clone = 1;
        } else if (js_isundefined(J, 1)) {
                pattern = "(?:)";
                flags = 0;
@@ -152,7 +178,7 @@
                if (m) flags |= JS_REGEXP_M;
        }
 
-       js_newregexp(J, pattern, flags);
+       js_newregexpx(J, pattern, flags, is_clone);
 }
 
 static void jsB_RegExp(js_State *J)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsrepr.c new/mujs-1.1.1/jsrepr.c
--- old/mujs-1.0.9/jsrepr.c     2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsrepr.c     2021-04-13 04:22:04.000000000 +0200
@@ -175,7 +175,6 @@
                        break;
                case JS_CFUNCTION:
                case JS_CSCRIPT:
-               case JS_CEVAL:
                        reprfun(J, sb, obj->u.f.function);
                        break;
                case JS_CCFUNCTION:
@@ -220,9 +219,10 @@
                        js_puts(J, sb, js_tostring(J, -1));
                        js_pop(J, 1);
                        js_putc(J, sb, '(');
-                       js_getproperty(J, -1, "message");
-                       reprstr(J, sb, js_tostring(J, -1));
-                       js_pop(J, 1);
+                       if (js_hasproperty(J, -1, "message")) {
+                               reprvalue(J, sb);
+                               js_pop(J, 1);
+                       }
                        js_puts(J, sb, "))");
                        break;
                case JS_CMATH:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsrun.c new/mujs-1.1.1/jsrun.c
--- old/mujs-1.0.9/jsrun.c      2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsrun.c      2021-04-13 04:22:04.000000000 +0200
@@ -200,7 +200,6 @@
        if (v->type == JS_TOBJECT)
                return v->u.object->type == JS_CFUNCTION ||
                        v->u.object->type == JS_CSCRIPT ||
-                       v->u.object->type == JS_CEVAL ||
                        v->u.object->type == JS_CCFUNCTION;
        return 0;
 }
@@ -250,6 +249,25 @@
        }
 }
 
+int js_type(js_State *J, int idx)
+{
+       js_Value *v = stackidx(J, idx);
+       switch (v->type) {
+       default:
+       case JS_TSHRSTR: return JS_ISSTRING;
+       case JS_TUNDEFINED: return JS_ISUNDEFINED;
+       case JS_TNULL: return JS_ISNULL;
+       case JS_TBOOLEAN: return JS_ISBOOLEAN;
+       case JS_TNUMBER: return JS_ISNUMBER;
+       case JS_TLITSTR: return JS_ISSTRING;
+       case JS_TMEMSTR: return JS_ISSTRING;
+       case JS_TOBJECT:
+               if (v->u.object->type == JS_CFUNCTION || v->u.object->type == 
JS_CCFUNCTION)
+                       return JS_ISFUNCTION;
+               return JS_ISOBJECT;
+       }
+}
+
 int js_toboolean(js_State *J, int idx)
 {
        return jsV_toboolean(J, stackidx(J, idx));
@@ -551,7 +569,7 @@
                js_pushundefined(J);
 }
 
-static void jsR_setproperty(js_State *J, js_Object *obj, const char *name)
+static void jsR_setproperty(js_State *J, js_Object *obj, const char *name, int 
transient)
 {
        js_Value *value = stackidx(J, -1);
        js_Property *ref;
@@ -616,8 +634,14 @@
        }
 
        /* Property not found on this object, so create one */
-       if (!ref || !own)
+       if (!ref || !own) {
+               if (transient) {
+                       if (J->strict)
+                               js_typeerror(J, "cannot create property '%s' on 
transient object", name);
+                       return;
+               }
                ref = jsV_setproperty(J, obj, name);
+       }
 
        if (ref) {
                if (!(ref->atts & JS_READONLY))
@@ -634,7 +658,8 @@
 }
 
 static void jsR_defproperty(js_State *J, js_Object *obj, const char *name,
-       int atts, js_Value *value, js_Object *getter, js_Object *setter)
+       int atts, js_Value *value, js_Object *getter, js_Object *setter,
+       int throw)
 {
        js_Property *ref;
        int k;
@@ -691,7 +716,7 @@
        return;
 
 readonly:
-       if (J->strict)
+       if (J->strict || throw)
                js_typeerror(J, "'%s' is read-only or non-configurable", name);
 }
 
@@ -778,7 +803,7 @@
 
 void js_setregistry(js_State *J, const char *name)
 {
-       jsR_setproperty(J, J->R, name);
+       jsR_setproperty(J, J->R, name, 0);
        js_pop(J, 1);
 }
 
@@ -794,13 +819,13 @@
 
 void js_setglobal(js_State *J, const char *name)
 {
-       jsR_setproperty(J, J->G, name);
+       jsR_setproperty(J, J->G, name, 0);
        js_pop(J, 1);
 }
 
 void js_defglobal(js_State *J, const char *name, int atts)
 {
-       jsR_defproperty(J, J->G, name, atts, stackidx(J, -1), NULL, NULL);
+       jsR_defproperty(J, J->G, name, atts, stackidx(J, -1), NULL, NULL, 0);
        js_pop(J, 1);
 }
 
@@ -816,13 +841,13 @@
 
 void js_setproperty(js_State *J, int idx, const char *name)
 {
-       jsR_setproperty(J, js_toobject(J, idx), name);
+       jsR_setproperty(J, js_toobject(J, idx), name, !js_isobject(J, idx));
        js_pop(J, 1);
 }
 
 void js_defproperty(js_State *J, int idx, const char *name, int atts)
 {
-       jsR_defproperty(J, js_toobject(J, idx), name, atts, stackidx(J, -1), 
NULL, NULL);
+       jsR_defproperty(J, js_toobject(J, idx), name, atts, stackidx(J, -1), 
NULL, NULL, 1);
        js_pop(J, 1);
 }
 
@@ -833,7 +858,7 @@
 
 void js_defaccessor(js_State *J, int idx, const char *name, int atts)
 {
-       jsR_defproperty(J, js_toobject(J, idx), name, atts, NULL, 
jsR_tofunction(J, -2), jsR_tofunction(J, -1));
+       jsR_defproperty(J, js_toobject(J, idx), name, atts, NULL, 
jsR_tofunction(J, -2), jsR_tofunction(J, -1), 1);
        js_pop(J, 2);
 }
 
@@ -871,7 +896,7 @@
 
 static void js_initvar(js_State *J, const char *name, int idx)
 {
-       jsR_defproperty(J, J->E->variables, name, JS_DONTENUM | JS_DONTCONF, 
stackidx(J, idx), NULL, NULL);
+       jsR_defproperty(J, J->E->variables, name, JS_DONTENUM | JS_DONTCONF, 
stackidx(J, idx), NULL, NULL, 0);
 }
 
 static int js_hasvar(js_State *J, const char *name)
@@ -918,7 +943,7 @@
        } while (E);
        if (J->strict)
                js_referenceerror(J, "assignment to undeclared variable '%s'", 
name);
-       jsR_setproperty(J, J->G, name);
+       jsR_setproperty(J, J->G, name, 0);
 }
 
 static int js_delvar(js_State *J, const char *name)
@@ -1021,32 +1046,6 @@
        jsR_restorescope(J);
 }
 
-static void jsR_calleval(js_State *J, int n, js_Function *F, js_Environment 
*scope)
-{
-       js_Value v;
-       int i;
-
-       scope = jsR_newenvironment(J, jsV_newobject(J, JS_COBJECT, NULL), 
scope);
-
-       jsR_savescope(J, scope);
-
-       /* scripts take no arguments */
-       js_pop(J, n);
-
-       for (i = 0; i < F->varlen; ++i) {
-               js_pushundefined(J);
-               js_initvar(J, F->vartab[i], -1);
-               js_pop(J, 1);
-       }
-
-       jsR_run(J, F);
-       v = *stackidx(J, -1);
-       TOP = --BOT; /* clear stack */
-       js_pushvalue(J, v);
-
-       jsR_restorescope(J);
-}
-
 static void jsR_callscript(js_State *J, int n, js_Function *F, js_Environment 
*scope)
 {
        js_Value v;
@@ -1059,9 +1058,12 @@
        js_pop(J, n);
 
        for (i = 0; i < F->varlen; ++i) {
-               js_pushundefined(J);
-               js_initvar(J, F->vartab[i], -1);
-               js_pop(J, 1);
+               /* Bug 701886: don't redefine existing vars in eval/scripts */
+               if (!js_hasvar(J, F->vartab[i])) {
+                       js_pushundefined(J);
+                       js_initvar(J, F->vartab[i], -1);
+                       js_pop(J, 1);
+               }
        }
 
        jsR_run(J, F);
@@ -1121,10 +1123,6 @@
                jsR_pushtrace(J, obj->u.f.function->name, 
obj->u.f.function->filename, obj->u.f.function->line);
                jsR_callscript(J, n, obj->u.f.function, obj->u.f.scope);
                --J->tracetop;
-       } else if (obj->type == JS_CEVAL) {
-               jsR_pushtrace(J, obj->u.f.function->name, 
obj->u.f.function->filename, obj->u.f.function->line);
-               jsR_calleval(J, n, obj->u.f.function, obj->u.f.scope);
-               --J->tracetop;
        } else if (obj->type == JS_CCFUNCTION) {
                jsR_pushtrace(J, obj->u.c.name, "native", 0);
                jsR_callcfunction(J, n, obj->u.c.length, obj->u.c.function);
@@ -1335,8 +1333,6 @@
 static void jsR_run(js_State *J, js_Function *F)
 {
        js_Function **FT = F->funtab;
-       double *NT = F->numtab;
-       const char **ST = F->strtab;
        const char **VT = F->vartab-1;
        int lightweight = F->lightweight;
        js_Instruction *pcstart = F->code;
@@ -1351,10 +1347,15 @@
        unsigned int ux, uy;
        int ix, iy, okay;
        int b;
+       int transient;
 
        savestrict = J->strict;
        J->strict = F->strict;
 
+#define READSTRING() \
+       memcpy(&str, pc, sizeof(str)); \
+       pc += sizeof(str) / sizeof(*pc)
+
        while (1) {
                if (J->gccounter > J->gcthresh)
                        js_gc(J, 0);
@@ -1371,14 +1372,28 @@
                case OP_ROT3: js_rot3(J); break;
                case OP_ROT4: js_rot4(J); break;
 
-               case OP_INTEGER: js_pushnumber(J, *pc++ - 32768); break;
-               case OP_NUMBER: js_pushnumber(J, NT[*pc++]); break;
-               case OP_STRING: js_pushliteral(J, ST[*pc++]); break;
+               case OP_INTEGER:
+                       js_pushnumber(J, *pc++ - 32768);
+                       break;
+
+               case OP_NUMBER:
+                       memcpy(&x, pc, sizeof(x));
+                       pc += sizeof(x) / sizeof(*pc);
+                       js_pushnumber(J, x);
+                       break;
+
+               case OP_STRING:
+                       READSTRING();
+                       js_pushliteral(J, str);
+                       break;
 
                case OP_CLOSURE: js_newfunction(J, FT[*pc++], J->E); break;
                case OP_NEWOBJECT: js_newobject(J); break;
                case OP_NEWARRAY: js_newarray(J); break;
-               case OP_NEWREGEXP: js_newregexp(J, ST[pc[0]], pc[1]); pc += 2; 
break;
+               case OP_NEWREGEXP:
+                       READSTRING();
+                       js_newregexp(J, str, *pc++);
+                       break;
 
                case OP_UNDEF: js_pushundefined(J); break;
                case OP_NULL: js_pushnull(J); break;
@@ -1430,22 +1445,25 @@
                        break;
 
                case OP_GETVAR:
-                       str = ST[*pc++];
+                       READSTRING();
                        if (!js_hasvar(J, str))
                                js_referenceerror(J, "'%s' is not defined", 
str);
                        break;
 
                case OP_HASVAR:
-                       if (!js_hasvar(J, ST[*pc++]))
+                       READSTRING();
+                       if (!js_hasvar(J, str))
                                js_pushundefined(J);
                        break;
 
                case OP_SETVAR:
-                       js_setvar(J, ST[*pc++]);
+                       READSTRING();
+                       js_setvar(J, str);
                        break;
 
                case OP_DELVAR:
-                       b = js_delvar(J, ST[*pc++]);
+                       READSTRING();
+                       b = js_delvar(J, str);
                        js_pushboolean(J, b);
                        break;
 
@@ -1458,24 +1476,28 @@
                        js_pushboolean(J, b);
                        break;
 
+               case OP_INITARRAY:
+                       js_setindex(J, -2, js_getlength(J, -2));
+                       break;
+
                case OP_INITPROP:
                        obj = js_toobject(J, -3);
                        str = js_tostring(J, -2);
-                       jsR_setproperty(J, obj, str);
+                       jsR_setproperty(J, obj, str, 0);
                        js_pop(J, 2);
                        break;
 
                case OP_INITGETTER:
                        obj = js_toobject(J, -3);
                        str = js_tostring(J, -2);
-                       jsR_defproperty(J, obj, str, 0, NULL, jsR_tofunction(J, 
-1), NULL);
+                       jsR_defproperty(J, obj, str, 0, NULL, jsR_tofunction(J, 
-1), NULL, 0);
                        js_pop(J, 2);
                        break;
 
                case OP_INITSETTER:
                        obj = js_toobject(J, -3);
                        str = js_tostring(J, -2);
-                       jsR_defproperty(J, obj, str, 0, NULL, NULL, 
jsR_tofunction(J, -1));
+                       jsR_defproperty(J, obj, str, 0, NULL, NULL, 
jsR_tofunction(J, -1), 0);
                        js_pop(J, 2);
                        break;
 
@@ -1487,7 +1509,7 @@
                        break;
 
                case OP_GETPROP_S:
-                       str = ST[*pc++];
+                       READSTRING();
                        obj = js_toobject(J, -1);
                        jsR_getproperty(J, obj, str);
                        js_rot2pop1(J);
@@ -1496,14 +1518,16 @@
                case OP_SETPROP:
                        str = js_tostring(J, -2);
                        obj = js_toobject(J, -3);
-                       jsR_setproperty(J, obj, str);
+                       transient = !js_isobject(J, -3);
+                       jsR_setproperty(J, obj, str, transient);
                        js_rot3pop2(J);
                        break;
 
                case OP_SETPROP_S:
-                       str = ST[*pc++];
+                       READSTRING();
                        obj = js_toobject(J, -2);
-                       jsR_setproperty(J, obj, str);
+                       transient = !js_isobject(J, -2);
+                       jsR_setproperty(J, obj, str, transient);
                        js_rot2pop1(J);
                        break;
 
@@ -1516,7 +1540,7 @@
                        break;
 
                case OP_DELPROP_S:
-                       str = ST[*pc++];
+                       READSTRING();
                        obj = js_toobject(J, -1);
                        b = jsR_delproperty(J, obj, str);
                        js_pop(J, 1);
@@ -1752,7 +1776,7 @@
                        break;
 
                case OP_CATCH:
-                       str = ST[*pc++];
+                       READSTRING();
                        obj = jsV_newobject(J, JS_COBJECT, NULL);
                        js_pushobject(J, obj);
                        js_rot2(J);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsstate.c new/mujs-1.1.1/jsstate.c
--- old/mujs-1.0.9/jsstate.c    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsstate.c    2021-04-13 04:22:04.000000000 +0200
@@ -113,7 +113,7 @@
        P = jsP_parse(J, filename, source);
        F = jsC_compilescript(J, P, iseval ? J->strict : J->default_strict);
        jsP_freeparse(J);
-       js_newscript(J, F, iseval ? (J->strict ? J->E : NULL) : J->GE, iseval ? 
JS_CEVAL : JS_CSCRIPT);
+       js_newscript(J, F, iseval ? (J->strict ? J->E : NULL) : J->GE);
 
        js_endtry(J);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsstring.c new/mujs-1.1.1/jsstring.c
--- old/mujs-1.0.9/jsstring.c   2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsstring.c   2021-04-13 04:22:04.000000000 +0200
@@ -665,7 +665,7 @@
 {
        if (js_isundefined(J, 1)) {
                js_newarray(J);
-               js_copy(J, 0);
+               js_pushstring(J, js_tostring(J, 0));
                js_setindex(J, -2, 0);
        } else if (js_isregexp(J, 1)) {
                Sp_split_regexp(J);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsvalue.c new/mujs-1.1.1/jsvalue.c
--- old/mujs-1.0.9/jsvalue.c    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsvalue.c    2021-04-13 04:22:04.000000000 +0200
@@ -7,6 +7,40 @@
 #define JSV_ISSTRING(v) (v->type==JS_TSHRSTR || v->type==JS_TMEMSTR || 
v->type==JS_TLITSTR)
 #define JSV_TOSTRING(v) (v->type==JS_TSHRSTR ? v->u.shrstr : 
v->type==JS_TLITSTR ? v->u.litstr : v->type==JS_TMEMSTR ? v->u.memstr->p : "")
 
+double js_strtol(const char *s, char **p, int base)
+{
+       /* ascii -> digit value. max base is 36. */
+       static const unsigned char table[256] = {
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 80, 80, 80, 80, 80,
+               80, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+               25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 80, 80, 80, 80, 80,
+               80, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+               25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+               80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
+       };
+       double x;
+       unsigned char c;
+       if (base == 10)
+               for (x = 0, c = *s++; (0 <= c - '0') && (c - '0' < 10); c = 
*s++)
+                       x = x * 10 + (c - '0');
+       else
+               for (x = 0, c = *s++; table[c] < base; c = *s++)
+                       x = x * base + table[c];
+       if (p)
+               *p = (char*)s-1;
+       return x;
+}
+
 int jsV_numbertointeger(double n)
 {
        if (n == 0) return 0;
@@ -172,10 +206,10 @@
                while (*e >= '0' && *e <= '9') ++e;
                isflt = 1;
        }
-       if (isflt || e - s > 9)
+       if (isflt)
                n = js_strtod(s, &end);
        else
-               n = strtol(s, &end, 10);
+               n = js_strtol(s, &end, 10);
        if (end == e) {
                *ep = (char*)e;
                return n;
@@ -191,7 +225,7 @@
        double n;
        while (jsY_iswhite(*s) || jsY_isnewline(*s)) ++s;
        if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X') && s[2] != 0)
-               n = strtol(s + 2, &e, 16);
+               n = js_strtol(s + 2, &e, 16);
        else if (!strncmp(s, "Infinity", 8))
                n = INFINITY, e = (char*)s + 8;
        else if (!strncmp(s, "+Infinity", 9))
@@ -421,9 +455,9 @@
        }
 }
 
-void js_newscript(js_State *J, js_Function *fun, js_Environment *scope, int 
type)
+void js_newscript(js_State *J, js_Function *fun, js_Environment *scope)
 {
-       js_Object *obj = jsV_newobject(J, type, NULL);
+       js_Object *obj = jsV_newobject(J, JS_CSCRIPT, NULL);
        obj->u.f.function = fun;
        obj->u.f.scope = scope;
        js_pushobject(J, obj);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/jsvalue.h new/mujs-1.1.1/jsvalue.h
--- old/mujs-1.0.9/jsvalue.h    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/jsvalue.h    2021-04-13 04:22:04.000000000 +0200
@@ -26,8 +26,7 @@
        JS_COBJECT,
        JS_CARRAY,
        JS_CFUNCTION,
-       JS_CSCRIPT, /* function created from global code */
-       JS_CEVAL, /* function created from eval code */
+       JS_CSCRIPT, /* function created from global/eval code */
        JS_CCFUNCTION, /* built-in function */
        JS_CERROR,
        JS_CBOOLEAN,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/main.c new/mujs-1.1.1/main.c
--- old/mujs-1.0.9/main.c       2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/main.c       2021-04-13 04:22:04.000000000 +0200
@@ -1,7 +1,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef _MSC_VER
+#include <io.h>
+#else
 #include <unistd.h>
+#endif
 #include <errno.h>
 
 #include "mujs.h"
@@ -216,10 +220,13 @@
        "require.cache = Object.create(null);\n"
 ;
 
+
 static const char *stacktrace_js =
        "Error.prototype.toString = function() {\n"
-       "if (this.stackTrace) return this.name + ': ' + this.message + 
this.stackTrace;\n"
-       "return this.name + ': ' + this.message;\n"
+       "var s = this.name;\n"
+       "if ('message' in this) s += ': ' + this.message;\n"
+       "if ('stackTrace' in this) s += this.stackTrace;\n"
+       "return s;\n"
        "};\n"
 ;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/mujs.h new/mujs-1.1.1/mujs.h
--- old/mujs-1.0.9/mujs.h       2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/mujs.h       2021-04-13 04:22:04.000000000 +0200
@@ -85,6 +85,17 @@
        JS_DONTCONF = 4,
 };
 
+/* enum for js_type() */
+enum {
+       JS_ISUNDEFINED,
+       JS_ISNULL,
+       JS_ISBOOLEAN,
+       JS_ISNUMBER,
+       JS_ISSTRING,
+       JS_ISFUNCTION,
+       JS_ISOBJECT
+};
+
 void js_report(js_State *J, const char *message);
 
 void js_newerror(js_State *J, const char *message);
@@ -217,6 +228,7 @@
 int js_strictequal(js_State *J);
 int js_instanceof(js_State *J);
 const char *js_typeof(js_State *J, int idx);
+int js_type(js_State *J, int idx);
 
 void js_repr(js_State *J, int idx);
 const char *js_torepr(js_State *J, int idx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/opnames.h new/mujs-1.1.1/opnames.h
--- old/mujs-1.0.9/opnames.h    2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/opnames.h    2021-04-13 04:22:04.000000000 +0200
@@ -25,6 +25,7 @@
 "setvar",
 "delvar",
 "in",
+"initarray",
 "initprop",
 "initgetter",
 "initsetter",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mujs-1.0.9/regexp.c new/mujs-1.1.1/regexp.c
--- old/mujs-1.0.9/regexp.c     2020-09-08 10:50:17.000000000 +0200
+++ new/mujs-1.1.1/regexp.c     2021-04-13 04:22:04.000000000 +0200
@@ -107,7 +107,7 @@
        return 0;
 }
 
-#define ESCAPES "BbDdSsWw^$\\.*+?()[]{}|0123456789"
+#define ESCAPES "BbDdSsWw^$\\.*+?()[]{}|-0123456789"
 
 static int isunicodeletter(int c)
 {
@@ -809,6 +809,21 @@
        }
 }
 
+static void dumpcclass(Reclass *cc) {
+       Rune *p;
+       for (p = cc->spans; p < cc->end; p += 2) {
+               if (p[0] > 32 && p[0] < 127)
+                       printf(" %c", p[0]);
+               else
+                       printf(" \\x%02x", p[0]);
+               if (p[1] > 32 && p[1] < 127)
+                       printf("-%c", p[1]);
+               else
+                       printf("-\\x%02x", p[1]);
+       }
+       putchar('\n');
+}
+
 static void dumpprog(Reprog *prog)
 {
        Reinst *inst;
@@ -824,8 +839,8 @@
                case I_ANY: puts("any"); break;
                case I_ANYNL: puts("anynl"); break;
                case I_CHAR: printf(inst->c >= 32 && inst->c < 127 ? "char 
'%c'\n" : "char U+%04X\n", inst->c); break;
-               case I_CCLASS: puts("cclass"); break;
-               case I_NCCLASS: puts("ncclass"); break;
+               case I_CCLASS: printf("cclass"); dumpcclass(inst->cc); break;
+               case I_NCCLASS: printf("ncclass"); dumpcclass(inst->cc); break;
                case I_REF: printf("ref %d\n", inst->n); break;
                case I_BOL: puts("bol"); break;
                case I_EOL: puts("eol"); break;

Reply via email to