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.
Unified · Split
| @@ -2,6 +2,8 @@ · 1 unmodified line | |||
| 2 | #include "jslex.h" | 2 | #include "jslex.h" |
| 3 | #include "jsvalue.h" | 3 | #include "jsvalue.h" |
| 4 | #include "jsbuiltin.h" | 4 | #include "jsbuiltin.h" |
| 5 | #include "jscompile.h" | ||
| 6 | #include "utf.h" | ||
| 5 | 7 | ||
| 6 | static void reprvalue(js_State *J, js_Buffer **sb); | 8 | static void reprvalue(js_State *J, js_Buffer **sb); |
| 7 | 9 | ||
| @@ -193,9 +195,12 @@ static void reprvalue(js_State *J, js_Buffer **sb) · 185 unmodified lines | |||
| 193 | if (obj->u.r.flags & JS_REGEXP_M) js_putc(J, sb, 'm'); | 195 | if (obj->u.r.flags & JS_REGEXP_M) js_putc(J, sb, 'm'); |
| 194 | break; | 196 | break; |
| 195 | case JS_CDATE: | 197 | case JS_CDATE: |
| 196 | js_puts(J, sb, "(new Date("); | 198 | { |
| 197 | fmtnum(J, sb, obj->u.number); | 199 | char buf[40]; |
| 198 | js_puts(J, sb, "))"); | 200 | js_puts(J, sb, "(new Date("); |
| 201 | js_puts(J, sb, jsV_numbertostring(J, buf, obj->u.number)); | ||
| 202 | js_puts(J, sb, "))"); | ||
| 203 | } | ||
| 199 | break; | 204 | break; |
| 200 | case JS_CERROR: | 205 | case JS_CERROR: |
| 201 | js_puts(J, sb, "(new "); | 206 | js_puts(J, sb, "(new "); |
| @@ -6,6 +6,7 @@ · 5 unmodified lines | |||
| 6 | #include "jsbuiltin.h" | 6 | #include "jsbuiltin.h" |
| 7 | 7 | ||
| 8 | #include <assert.h> | 8 | #include <assert.h> |
| 9 | #include <errno.h> | ||
| 9 | 10 | ||
| 10 | static void *js_defaultalloc(void *actx, void *ptr, int size) | 11 | static void *js_defaultalloc(void *actx, void *ptr, int size) |
| 11 | { | 12 | { |