Skip to content

Commit 9d871f8

Browse files
committed
update to quickjs 2020-07-05
1 parent 8728a0d commit 9d871f8

31 files changed

Lines changed: 4082 additions & 1671 deletions

Changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2020-07-05:
2+
3+
- modified JS_GetPrototype() to return a live value
4+
- REPL: support unicode characters larger than 16 bits
5+
- added os.Worker
6+
- improved object serialization
7+
- added std.parseExtJSON
8+
- misc bug fixes
9+
110
2020-04-12:
211

312
- added cross realm support

Makefile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\"
106106
ifdef CONFIG_BIGNUM
107107
DEFINES+=-DCONFIG_BIGNUM
108108
endif
109+
ifdef CONFIG_WIN32
110+
ifndef CONFIG_WIN64
111+
DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
112+
endif
113+
endif
114+
109115
CFLAGS+=$(DEFINES)
110116
CFLAGS_DEBUG=$(CFLAGS) -O0
111117
CFLAGS_SMALL=$(CFLAGS) -Os
@@ -122,8 +128,8 @@ CFLAGS+=-p
122128
LDFLAGS+=-p
123129
endif
124130
ifdef CONFIG_ASAN
125-
CFLAGS+=-fsanitize=address
126-
LDFLAGS+=-fsanitize=address
131+
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
132+
LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer
127133
endif
128134
ifdef CONFIG_WIN32
129135
LDEXPORT=
@@ -179,10 +185,11 @@ QJS_LIB_OBJS+=$(OBJDIR)/libbf.o
179185
QJS_OBJS+=$(OBJDIR)/qjscalc.o
180186
endif
181187

188+
HOST_LIBS=-lm -ldl -lpthread
182189
LIBS=-lm
183190
ifndef CONFIG_WIN32
184191
ifndef CONFIG_WIN64
185-
LIBS+=-ldl
192+
LIBS+=-ldl -lpthread
186193
endif
187194
endif
188195

@@ -202,7 +209,7 @@ ifneq ($(CROSS_PREFIX),)
202209

203210
$(QJSC): $(OBJDIR)/qjsc.host.o \
204211
$(patsubst %.o, %.host.o, $(QJS_LIB_OBJS))
205-
$(HOST_CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(LIBS)
212+
$(HOST_CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(HOST_LIBS)
206213

207214
endif #CROSS_PREFIX
208215

@@ -254,13 +261,13 @@ libunicode-table.h: unicode_gen
254261
endif
255262

256263
run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
257-
$(CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(LIBS) -lpthread
264+
$(CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(LIBS)
258265

259266
run-test262-debug: $(patsubst %.o, %.debug.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
260-
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
267+
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
261268

262269
run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
263-
$(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
270+
$(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS)
264271

265272
# object suffix order: nolto, [m32|m32s]
266273

@@ -300,7 +307,7 @@ unicode_gen: $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o libunicode.c u
300307
clean:
301308
rm -f repl.c qjscalc.c out.c
302309
rm -f *.a *.o *.d *~ jscompress unicode_gen regexp_test $(PROGS)
303-
rm -f hello.c hello_module.c test_fib.c
310+
rm -f hello.c test_fib.c
304311
rm -f examples/*.so tests/*.so
305312
rm -rf $(OBJDIR)/ *.dSYM/ qjs-debug
306313
rm -rf run-test262-debug run-test262-32
@@ -394,10 +401,11 @@ endif
394401

395402
test: qjs
396403
./qjs tests/test_closure.js
397-
./qjs tests/test_op.js
404+
./qjs tests/test_language.js
398405
./qjs tests/test_builtin.js
399406
./qjs tests/test_loop.js
400407
./qjs tests/test_std.js
408+
./qjs tests/test_worker.js
401409
ifndef CONFIG_DARWIN
402410
ifdef CONFIG_BIGNUM
403411
./qjs --bignum tests/test_bjson.js
@@ -413,10 +421,11 @@ ifdef CONFIG_BIGNUM
413421
endif
414422
ifdef CONFIG_M32
415423
./qjs32 tests/test_closure.js
416-
./qjs32 tests/test_op.js
424+
./qjs32 tests/test_language.js
417425
./qjs32 tests/test_builtin.js
418426
./qjs32 tests/test_loop.js
419427
./qjs32 tests/test_std.js
428+
./qjs32 tests/test_worker.js
420429
ifdef CONFIG_BIGNUM
421430
./qjs32 --bignum tests/test_op_overloading.js
422431
./qjs32 --bignum tests/test_bignum.js

TODO

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Misc:
2+
- use realpath in module name normalizer and put it in quickjs-libc
23
- use custom printf to avoid C library compatibility issues
34
- rename CONFIG_ALL_UNICODE, CONFIG_BIGNUM, CONFIG_ATOMICS, CONFIG_CHECK_JSVALUE ?
45
- unify coding style and naming conventions
@@ -56,12 +57,12 @@ Extensions:
5657
handle #if, #ifdef, #line, limited support for #define
5758
- get rid of __loadScript, use more common name
5859
- BSD sockets
59-
- Workers
6060

6161
REPL:
6262
- debugger
6363
- readline: support MS Windows terminal
6464
- readline: handle dynamic terminal resizing
65+
- readline: handle double width unicode characters
6566
- multiline editing
6667
- runtime object and function inspectors
6768
- interactive object browser
@@ -73,6 +74,5 @@ REPL:
7374
Test262o: 0/11262 errors, 463 excluded
7475
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
7576

76-
Test262: 28/70829 errors, 877 excluded, 425 skipped
77-
Test262 commit: 4a8e49b3ca7f9f74a4cafe6621ff9ba548ccc353
78-
77+
Test262: 30/71095 errors, 870 excluded, 549 skipped
78+
Test262 commit: 281eb10b2844929a7c0ac04527f5b42ce56509fd

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2020-04-12
1+
2020-07-05

cutils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ void dbuf_free(DynBuf *s);
268268
static inline BOOL dbuf_error(DynBuf *s) {
269269
return s->error;
270270
}
271+
static inline void dbuf_set_error(DynBuf *s)
272+
{
273+
s->error = TRUE;
274+
}
271275

272276
#define UTF8_CHAR_LEN_MAX 6
273277

doc/jsbignum.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/jsbignum.pdf

-8 Bytes
Binary file not shown.

doc/quickjs.html

Lines changed: 77 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/quickjs.pdf

1.82 KB
Binary file not shown.

0 commit comments

Comments
 (0)