From 8ee595bee72dac79d3ee4d3fe06358088ccd1e95 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 10 Jan 2020 11:08:37 +0100 Subject: [PATCH] Bug 701355: Fix separate compilation issues that have crept in. We normally build as one compilation unit with "one.c" but we should still be able to build each source file as a separate compilation unit if desired. --- jsrepr.c | 11 ++++++++--- jsstate.c | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jsrepr.c b/jsrepr.c index ce7087c..e21f9d8 100644 --- a/jsrepr.c +++ b/jsrepr.c @@ -2,6 +2,8 @@ #include "jslex.h" #include "jsvalue.h" #include "jsbuiltin.h" +#include "jscompile.h" +#include "utf.h" static void reprvalue(js_State *J, js_Buffer **sb); @@ -193,9 +195,12 @@ static void reprvalue(js_State *J, js_Buffer **sb) if (obj->u.r.flags & JS_REGEXP_M) js_putc(J, sb, 'm'); break; case JS_CDATE: - js_puts(J, sb, "(new Date("); - fmtnum(J, sb, obj->u.number); - js_puts(J, sb, "))"); + { + char buf[40]; + js_puts(J, sb, "(new Date("); + js_puts(J, sb, jsV_numbertostring(J, buf, obj->u.number)); + js_puts(J, sb, "))"); + } break; case JS_CERROR: js_puts(J, sb, "(new "); diff --git a/jsstate.c b/jsstate.c index 34b703f..32455e3 100644 --- a/jsstate.c +++ b/jsstate.c @@ -6,6 +6,7 @@ #include "jsbuiltin.h" #include +#include static void *js_defaultalloc(void *actx, void *ptr, int size) {