From 89007660998db0ee55f0ab3b34bb1a84f86fd3c4 Mon Sep 17 00:00:00 2001 From: bellard <6490144+bellard@users.noreply.github.com> Date: Sun, 6 Sep 2020 19:07:30 +0200 Subject: [PATCH] 2020-07-05 release --- Changelog | 9 + Makefile | 27 +- TODO | 8 +- VERSION | 2 +- cutils.h | 4 + doc/jsbignum.html | 4 +- doc/jsbignum.pdf | Bin 153057 -> 153049 bytes doc/quickjs.html | 95 +- doc/quickjs.pdf | Bin 163753 -> 165612 bytes doc/quickjs.texi | 70 +- examples/point.c | 2 +- libbf.c | 75 +- libregexp.c | 49 +- qjs.c | 15 +- qjsc.c | 17 +- quickjs-atom.h | 1 + quickjs-libc.c | 1438 +++++++--- quickjs-libc.h | 9 + quickjs.c | 3327 +++++++++++++++--------- quickjs.h | 29 +- repl.js | 72 +- test262.conf | 1 + test262_errors.txt | 6 +- tests/bjson.c | 16 +- tests/microbench.js | 14 + tests/test_bjson.js | 80 +- tests/test_builtin.js | 4 + tests/{test_op.js => test_language.js} | 16 +- tests/test_std.js | 21 + tests/test_worker.js | 93 + 30 files changed, 3775 insertions(+), 1729 deletions(-) rename tests/{test_op.js => test_language.js} (96%) create mode 100644 tests/test_worker.js diff --git a/Changelog b/Changelog index 0f447db..86d965c 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,12 @@ +2020-07-05: + +- modified JS_GetPrototype() to return a live value +- REPL: support unicode characters larger than 16 bits +- added os.Worker +- improved object serialization +- added std.parseExtJSON +- misc bug fixes + 2020-04-12: - added cross realm support diff --git a/Makefile b/Makefile index 88e605b..94c8e31 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,10 @@ DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\" ifdef CONFIG_BIGNUM DEFINES+=-DCONFIG_BIGNUM endif +ifdef CONFIG_WIN32 +DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior +endif + CFLAGS+=$(DEFINES) CFLAGS_DEBUG=$(CFLAGS) -O0 CFLAGS_SMALL=$(CFLAGS) -Os @@ -115,8 +119,8 @@ CFLAGS+=-p LDFLAGS+=-p endif ifdef CONFIG_ASAN -CFLAGS+=-fsanitize=address -LDFLAGS+=-fsanitize=address +CFLAGS+=-fsanitize=address -fno-omit-frame-pointer +LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer endif ifdef CONFIG_WIN32 LDEXPORT= @@ -166,9 +170,10 @@ QJS_LIB_OBJS+=$(OBJDIR)/libbf.o QJS_OBJS+=$(OBJDIR)/qjscalc.o endif +HOST_LIBS=-lm -ldl -lpthread LIBS=-lm ifndef CONFIG_WIN32 -LIBS+=-ldl +LIBS+=-ldl -lpthread endif $(OBJDIR): @@ -187,7 +192,7 @@ ifneq ($(CROSS_PREFIX),) $(QJSC): $(OBJDIR)/qjsc.host.o \ $(patsubst %.o, %.host.o, $(QJS_LIB_OBJS)) - $(HOST_CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(HOST_CC) $(LDFLAGS) -o $@ $^ $(HOST_LIBS) endif #CROSS_PREFIX @@ -239,13 +244,13 @@ libunicode-table.h: unicode_gen endif run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) run-test262-debug: $(patsubst %.o, %.debug.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)) - $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread + $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) # object suffix order: nolto, [m32|m32s] @@ -285,7 +290,7 @@ unicode_gen: $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o libunicode.c u clean: rm -f repl.c qjscalc.c out.c rm -f *.a *.o *.d *~ jscompress unicode_gen regexp_test $(PROGS) - rm -f hello.c hello_module.c test_fib.c + rm -f hello.c test_fib.c rm -f examples/*.so tests/*.so rm -rf $(OBJDIR)/ *.dSYM/ qjs-debug rm -rf run-test262-debug run-test262-32 @@ -379,10 +384,11 @@ endif test: qjs ./qjs tests/test_closure.js - ./qjs tests/test_op.js + ./qjs tests/test_language.js ./qjs tests/test_builtin.js ./qjs tests/test_loop.js ./qjs tests/test_std.js + ./qjs tests/test_worker.js ifndef CONFIG_DARWIN ifdef CONFIG_BIGNUM ./qjs --bignum tests/test_bjson.js @@ -398,10 +404,11 @@ ifdef CONFIG_BIGNUM endif ifdef CONFIG_M32 ./qjs32 tests/test_closure.js - ./qjs32 tests/test_op.js + ./qjs32 tests/test_language.js ./qjs32 tests/test_builtin.js ./qjs32 tests/test_loop.js ./qjs32 tests/test_std.js + ./qjs32 tests/test_worker.js ifdef CONFIG_BIGNUM ./qjs32 --bignum tests/test_op_overloading.js ./qjs32 --bignum tests/test_bignum.js diff --git a/TODO b/TODO index 8cfe0be..e5583c1 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,5 @@ Misc: +- use realpath in module name normalizer and put it in quickjs-libc - use custom printf to avoid C library compatibility issues - rename CONFIG_ALL_UNICODE, CONFIG_BIGNUM, CONFIG_ATOMICS, CONFIG_CHECK_JSVALUE ? - unify coding style and naming conventions @@ -56,12 +57,12 @@ Extensions: handle #if, #ifdef, #line, limited support for #define - get rid of __loadScript, use more common name - BSD sockets -- Workers REPL: - debugger - readline: support MS Windows terminal - readline: handle dynamic terminal resizing +- readline: handle double width unicode characters - multiline editing - runtime object and function inspectors - interactive object browser @@ -73,6 +74,5 @@ REPL: Test262o: 0/11262 errors, 463 excluded Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch) -Test262: 28/70829 errors, 877 excluded, 425 skipped -Test262 commit: 4a8e49b3ca7f9f74a4cafe6621ff9ba548ccc353 - +Test262: 30/71095 errors, 870 excluded, 549 skipped +Test262 commit: 281eb10b2844929a7c0ac04527f5b42ce56509fd diff --git a/VERSION b/VERSION index 69f162a..e970cf6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2020-04-12 +2020-07-05 diff --git a/cutils.h b/cutils.h index 26c68ee..31f7cd8 100644 --- a/cutils.h +++ b/cutils.h @@ -268,6 +268,10 @@ void dbuf_free(DynBuf *s); static inline BOOL dbuf_error(DynBuf *s) { return s->error; } +static inline void dbuf_set_error(DynBuf *s) +{ + s->error = TRUE; +} #define UTF8_CHAR_LEN_MAX 6 diff --git a/doc/jsbignum.html b/doc/jsbignum.html index ab31612..62c0287 100644 --- a/doc/jsbignum.html +++ b/doc/jsbignum.html @@ -1,7 +1,8 @@ - +
+