ref: 8ee595bee72dac79d3ee4d3fe06358088ccd1e95
parent: d248b0ce1800a1ebf2c853f205c1947642185c6a
author: Tor Andersson <[email protected]>
date: Fri Jan 10 06:08:37 EST 2020
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.
--- 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 @@
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 ");
--- a/jsstate.c
+++ b/jsstate.c
@@ -6,6 +6,7 @@
#include "jsbuiltin.h"
#include <assert.h>
+#include <errno.h>
static void *js_defaultalloc(void *actx, void *ptr, int size)
{