Skip to content

Commit 648a8f5

Browse files
authored
Improve Date.parse (#289)
* Improve `Date.parse()` - rewrite `Date.parse()` with separate parsers - return `NaN` for out of bounds field values as specified - add `js_tzabbr` and `string_get_tzabbr` to handle timezone abbreviations - improve `string_get_milliseconds` readability - accept up to 9 decimals for millisecond fraction but truncate at 3 - accept many more alternative date/time formats - add test cases in **tests/test_builtin.js** - produce readable output for `Date` objects in repl - use `JSON.stringify` to output `Date` and `string` values in **repl.js** - remove `String.prototype.__quote` - add `minimum_length` macro to specify argument array sizes (C99 except MSVC) - v8.js: parse all environment variables and output them, update **v8.txt**
1 parent c61336c commit 648a8f5

File tree

8 files changed

+11002
-10829
lines changed

8 files changed

+11002
-10829
lines changed

cutils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ static void *__builtin_frame_address(unsigned int level) {
108108
#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
109109
#endif
110110

111+
#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
112+
#define minimum_length(n) static n
113+
#else
114+
#define minimum_length(n) n
115+
#endif
116+
111117
typedef int BOOL;
112118

113119
#ifndef FALSE

gen/repl.c

Lines changed: 10521 additions & 10460 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)