Skip to content

Commit 0e8fffd

Browse files
committed
2020-01-19 release
1 parent 91459fb commit 0e8fffd

26 files changed

+4266
-3607
lines changed

Changelog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2020-01-19:
2+
3+
- keep CONFIG_BIGNUM in the makefile
4+
- added os.chdir()
5+
- qjs: added -I option
6+
- more memory checks in the bignum operations
7+
- modified operator overloading semantics to be closer to the TC39
8+
proposal
9+
- suppressed "use bigint" mode. Simplified "use math" mode
10+
- BigDecimal: changed suffix from 'd' to 'm'
11+
- misc bug fixes
12+
113
2020-01-05:
214

315
- always compile the bignum code. Added '--bignum' option to qjs.

Makefile

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
22
# QuickJS Javascript Engine
33
#
4-
# Copyright (c) 2017-2019 Fabrice Bellard
5-
# Copyright (c) 2017-2019 Charlie Gordon
4+
# Copyright (c) 2017-2020 Fabrice Bellard
5+
# Copyright (c) 2017-2020 Charlie Gordon
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy
88
# of this software and associated documentation files (the "Software"), to deal
@@ -47,6 +47,8 @@ prefix=/usr/local
4747
#CONFIG_PROFILE=y
4848
# use address sanitizer
4949
#CONFIG_ASAN=y
50+
# include the code for BigInt/BigFloat/BigDecimal and math mode
51+
CONFIG_BIGNUM=y
5052

5153
OBJDIR=.obj
5254

@@ -94,6 +96,9 @@ ifdef CONFIG_WERROR
9496
CFLAGS+=-Werror
9597
endif
9698
DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\"
99+
ifdef CONFIG_BIGNUM
100+
DEFINES+=-DCONFIG_BIGNUM
101+
endif
97102
CFLAGS+=$(DEFINES)
98103
CFLAGS_DEBUG=$(CFLAGS) -O0
99104
CFLAGS_SMALL=$(CFLAGS) -Os
@@ -153,9 +158,13 @@ endif
153158

154159
all: $(OBJDIR) $(OBJDIR)/quickjs.check.o $(OBJDIR)/qjs.check.o $(PROGS)
155160

156-
QJS_LIB_OBJS=$(OBJDIR)/quickjs.o $(OBJDIR)/libregexp.o $(OBJDIR)/libunicode.o $(OBJDIR)/libbf.o $(OBJDIR)/cutils.o $(OBJDIR)/quickjs-libc.o
161+
QJS_LIB_OBJS=$(OBJDIR)/quickjs.o $(OBJDIR)/libregexp.o $(OBJDIR)/libunicode.o $(OBJDIR)/cutils.o $(OBJDIR)/quickjs-libc.o
157162

158-
QJS_OBJS=$(OBJDIR)/qjs.o $(OBJDIR)/repl.o $(OBJDIR)/qjscalc.o $(QJS_LIB_OBJS)
163+
QJS_OBJS=$(OBJDIR)/qjs.o $(OBJDIR)/repl.o $(QJS_LIB_OBJS)
164+
ifdef CONFIG_BIGNUM
165+
QJS_LIB_OBJS+=$(OBJDIR)/libbf.o
166+
QJS_OBJS+=$(OBJDIR)/qjscalc.o
167+
endif
159168

160169
LIBS=-lm
161170
ifndef CONFIG_WIN32
@@ -215,7 +224,7 @@ libquickjs.a: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS))
215224
$(AR) rcs $@ $^
216225
endif # CONFIG_LTO
217226

218-
repl.c: $(QJSC) repl.js
227+
repl.c: $(QJSC) repl.js
219228
$(QJSC) -c -o $@ -m repl.js
220229

221230
qjscalc.c: $(QJSC) qjscalc.js
@@ -301,7 +310,10 @@ endif
301310
HELLO_SRCS=examples/hello.js
302311
HELLO_OPTS=-fno-string-normalize -fno-map -fno-promise -fno-typedarray \
303312
-fno-typedarray -fno-regexp -fno-json -fno-eval -fno-proxy \
304-
-fno-date -fno-module-loader -fno-bigint
313+
-fno-date -fno-module-loader
314+
ifdef CONFIG_BIGNUM
315+
HELLO_OPTS+=-fno-bigint
316+
endif
305317

306318
hello.c: $(QJSC) $(HELLO_SRCS)
307319
$(QJSC) -e $(HELLO_OPTS) -o $@ $(HELLO_SRCS)
@@ -372,20 +384,30 @@ test: qjs
372384
./qjs tests/test_loop.js
373385
./qjs tests/test_std.js
374386
ifndef CONFIG_DARWIN
387+
ifdef CONFIG_BIGNUM
375388
./qjs --bignum tests/test_bjson.js
389+
else
390+
./qjs tests/test_bjson.js
391+
endif
376392
./qjs examples/test_point.js
377393
endif
394+
ifdef CONFIG_BIGNUM
395+
./qjs --bignum tests/test_op_overloading.js
378396
./qjs --bignum tests/test_bignum.js
379397
./qjs --qjscalc tests/test_qjscalc.js
398+
endif
380399
ifdef CONFIG_M32
381400
./qjs32 tests/test_closure.js
382401
./qjs32 tests/test_op.js
383402
./qjs32 tests/test_builtin.js
384403
./qjs32 tests/test_loop.js
385404
./qjs32 tests/test_std.js
405+
ifdef CONFIG_BIGNUM
406+
./qjs32 --bignum tests/test_op_overloading.js
386407
./qjs32 --bignum tests/test_bignum.js
387408
./qjs32 --qjscalc tests/test_qjscalc.js
388409
endif
410+
endif
389411

390412
stats: qjs qjs32
391413
./qjs -qd

TODO

+2-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,5 @@ REPL:
7373
Test262o: 0/11262 errors, 463 excluded
7474
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
7575

76-
Test262: 4/67619 errors, 913 excluded, 1660 skipped
77-
Test262bn: 4/69722 errors, 846 excluded, 672 skipped
78-
test262 commit: 19fd4bea797646ae9bbfc9d325f14052ca370b54
76+
Test262: 17/69942 errors, 855 excluded, 581 skipped
77+
test262 commit: 28b4fcca4b1b1d278dfe0cc0e69c7d9d59b31aab

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2020-01-05
1+
2020-01-19

0 commit comments

Comments
 (0)