Skip to content

Commit d1c9171

Browse files
author
llgoer
committed
更新到2019-07-28版本
1 parent 7d92dd7 commit d1c9171

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1053
-355
lines changed

Changelog

100755100644
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2019-07-28:
2+
3+
- added dynamic import
4+
- added Promise.allSettled
5+
- added String.prototype.matchAll
6+
- added Object.fromEntries
7+
- reduced number of ticks in await
8+
- added BigInt support in Atomics
9+
- exported JS_NewPromiseCapability()
10+
- misc async function and async generator fixes
11+
- enabled hashbang support by default
12+
113
2019-07-21:
214

315
- updated test262 tests

Makefile

100755100644
File mode changed.

TODO

100755100644
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
- use 2 bytecode DynBufs in JSFunctionDef, one for reading, one for writing
1212
and use the same wrappers in all phases
1313
- use more generic method for line numbers in resolve_variables and resolve_labels
14-
- bignum:
15-
- fix Atomics support
1614

1715
Memory:
1816
- test border cases for max number of atoms, object properties, string length
@@ -78,6 +76,6 @@ REPL:
7876
- close all predefined methods in repl.js and jscalc.js
7977

8078
Test262o: 0/11262 errors, 463 excluded
81-
Test262: 51/56682 errors, 787 excluded, 6289 skipped
82-
Test262bn: 56/58017 errors, 1007 excluded, 5398 skipped
83-
test262 commit: 51d1abadce1de0b38594b7c9972ee60762f35dd0
79+
Test262: 33/58145 errors, 785 excluded, 5576 skipped
80+
Test262bn: 39/60250 errors, 718 excluded, 4587 skipped
81+
test262 commit: 2ee3864136747ee69401b2d266e234cdd0a95965

VERSION

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2019-07-21
1+
2019-07-28

bjson.c

100755100644
File mode changed.

cutils.c

100755100644
File mode changed.

cutils.h

100755100644
File mode changed.

doc/jsbignum.html

100755100644
File mode changed.

doc/jsbignum.pdf

100755100644
File mode changed.

doc/jsbignum.texi

100755100644
File mode changed.

doc/quickjs.html

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

doc/quickjs.pdf

100755100644
-699 Bytes
Binary file not shown.

doc/quickjs.texi

100755100644
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@chapter Introduction
2121

2222
QuickJS is a small and embeddable Javascript engine. It supports the
23-
ES2019 specification including modules, asynchronous
23+
ES2020 specification including modules, asynchronous
2424
generators and proxies.
2525

2626
It optionally supports mathematical extensions such as big integers
@@ -33,9 +33,9 @@ overloading.
3333

3434
@item Small and easily embeddable: just a few C files, no external dependency, 180 KiB of x86 code for a simple ``hello world'' program.
3535

36-
@item Fast interpreter with very low startup time: runs the 56000 tests of the ECMAScript Test Suite@footnote{@url{https://github.com/tc39/test262}} in about 100 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
36+
@item Fast interpreter with very low startup time: runs the 58000 tests of the ECMAScript Test Suite@footnote{@url{https://github.com/tc39/test262}} in about 85 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
3737

38-
@item Almost complete ES2019 support including modules, asynchronous
38+
@item Almost complete ES2020 support including modules, asynchronous
3939
generators and full Annex B support (legacy web compatibility).
4040

4141
@item Passes nearly 100% of the ECMAScript Test Suite tests.
@@ -207,7 +207,6 @@ Alternatively, the test262 tests can be installed with:
207207
@example
208208
git clone https://github.com/tc39/test262.git test262
209209
cd test262
210-
git checkout 51d1abadce1de0b38594b7c9972ee60762f35dd0
211210
patch -p1 < ../tests/test262.patch
212211
cd ..
213212
@end example
@@ -230,9 +229,9 @@ the test262 runner. The configuration files @code{test262.conf} and
230229

231230
@section Language support
232231

233-
@subsection ES2019 support
232+
@subsection ES2020 support
234233

235-
The ES2019 specification
234+
The ES2020 specification
236235
@footnote{@url{https://tc39.github.io/ecma262/}} is almost fully
237236
supported including the Annex B (legacy web compatibility) and the
238237
Unicode related features. The following features are not supported
@@ -773,7 +772,7 @@ stack holds the Javascript parameters and local variables.
773772
@section RegExp
774773

775774
A specific regular expression engine was developped. It is both small
776-
and efficient and supports all the ES2019 features including the
775+
and efficient and supports all the ES2020 features including the
777776
Unicode properties. As the Javascript compiler, it directly generates
778777
bytecode without a parse tree.
779778

examples/c_module.js

100755100644
File mode changed.

examples/fib.c

100755100644
File mode changed.

examples/fib_module.js

100755100644
File mode changed.

examples/hello.js

100755100644
File mode changed.

examples/hello_module.js

100755100644
File mode changed.

examples/pi.js

100755100644
File mode changed.

jscompress.c

100755100644
File mode changed.

libbf.c

100755100644
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,11 +2522,12 @@ int bf_atof2(bf_t *r, slimb_t *pexponent,
25222522
radix == 0 && (flags & BF_ATOF_BIN_OCT)) {
25232523
p += 2;
25242524
radix = 2;
2525-
} else if ((p[1] >= '0' && p[1] <= '7') &&
2525+
} else if ((p[1] >= '0' && p[1] <= '9') &&
25262526
radix == 0 && (flags & BF_ATOF_LEGACY_OCTAL)) {
25272527
int i;
25282528
/* the separator is not allowed in legacy octal literals */
2529-
for (i = 2; (p[i] >= '0' && p[i] <= '7'); i++)
2529+
sep = 256;
2530+
for (i = 1; (p[i] >= '0' && p[i] <= '7'); i++)
25302531
continue;
25312532
if (p[i] == '8' || p[i] == '9')
25322533
goto no_prefix;

libbf.h

100755100644
File mode changed.

libregexp-opcode.h

100755100644
File mode changed.

libregexp.c

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,8 @@ int main(int argc, char **argv)
25112511
printf("usage: %s regexp input\n", argv[0]);
25122512
exit(1);
25132513
}
2514-
bc = lre_compile(&len, error_msg, sizeof(error_msg), argv[1], 0, 0, NULL);
2514+
bc = lre_compile(&len, error_msg, sizeof(error_msg), argv[1],
2515+
strlen(argv[1]), 0, NULL);
25152516
if (!bc) {
25162517
fprintf(stderr, "error: %s\n", error_msg);
25172518
exit(1);

libregexp.h

100755100644
File mode changed.

libunicode-table.h

100755100644
File mode changed.

libunicode.c

100755100644
File mode changed.

libunicode.h

100755100644
File mode changed.

list.h

100755100644
File mode changed.

qjs.c

100755100644
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ int main(int argc, char **argv)
414414
eval_flags = JS_EVAL_TYPE_MODULE;
415415
else
416416
eval_flags = JS_EVAL_TYPE_GLOBAL;
417-
eval_flags |= JS_EVAL_FLAG_SHEBANG;
418417
if (eval_file(ctx, filename, eval_flags))
419418
goto fail;
420419
}

qjsc.c

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void compile_file(JSContext *ctx, FILE *fo,
250250
fprintf(stderr, "Could not load '%s'\n", filename);
251251
exit(1);
252252
}
253-
eval_flags = JS_EVAL_FLAG_SHEBANG | JS_EVAL_FLAG_COMPILE_ONLY;
253+
eval_flags = JS_EVAL_FLAG_COMPILE_ONLY;
254254
if (is_module)
255255
eval_flags |= JS_EVAL_TYPE_MODULE;
256256
else

qjscalc.js

100755100644
File mode changed.

quickjs-atom.h

100755100644
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ DEF(revoke, "revoke")
158158
DEF(async, "async")
159159
DEF(exec, "exec")
160160
DEF(groups, "groups")
161+
DEF(status, "status")
162+
DEF(reason, "reason")
161163
#ifdef CONFIG_BIGNUM
162164
DEF(bigint, "bigint")
163165
DEF(bigfloat, "bigfloat")
@@ -214,6 +216,7 @@ DEF(Map_Iterator, "Map Iterator")
214216
DEF(Set_Iterator, "Set Iterator")
215217
DEF(Array_Iterator, "Array Iterator")
216218
DEF(String_Iterator, "String Iterator")
219+
DEF(RegExp_String_Iterator, "RegExp String Iterator")
217220
DEF(Generator, "Generator")
218221
DEF(Proxy, "Proxy")
219222
DEF(Promise, "Promise")
@@ -236,6 +239,7 @@ DEF(InternalError, "InternalError")
236239
DEF(Symbol_toPrimitive, "Symbol.toPrimitive")
237240
DEF(Symbol_iterator, "Symbol.iterator")
238241
DEF(Symbol_match, "Symbol.match")
242+
DEF(Symbol_matchAll, "Symbol.matchAll")
239243
DEF(Symbol_replace, "Symbol.replace")
240244
DEF(Symbol_search, "Symbol.search")
241245
DEF(Symbol_split, "Symbol.split")

quickjs-libc.c

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static JSValue js_loadScript(JSContext *ctx, JSValueConst this_val,
336336
return JS_EXCEPTION;
337337
}
338338
ret = JS_Eval(ctx, (char *)buf, buf_len, filename,
339-
JS_EVAL_TYPE_GLOBAL | JS_EVAL_FLAG_SHEBANG);
339+
JS_EVAL_TYPE_GLOBAL);
340340
js_free(ctx, buf);
341341
JS_FreeCString(ctx, filename);
342342
return ret;

quickjs-libc.h

100755100644
File mode changed.

quickjs-opcode.h

100755100644
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,8 @@ DEF( push_false, 1, 0, 1, none)
7575
DEF( push_true, 1, 0, 1, none)
7676
DEF( object, 1, 0, 1, none)
7777
DEF( var_object, 1, 0, 1, none)
78-
DEF( this_func, 1, 0, 1, none) /* only used at the start of a function */
79-
DEF( arguments, 2, 0, 1, none) /* only used at the start of a function */
78+
DEF( special_object, 2, 0, 1, u8) /* only used at the start of a function */
8079
DEF( rest, 3, 0, 1, u16) /* only used at the start of a function */
81-
DEF( new_target, 1, 0, 1, none) /* only used at the start of a function */
82-
DEF( home_object, 1, 0, 1, none) /* only used at the start of a function */
8380

8481
DEF( drop, 1, 1, 0, none) /* a -> */
8582
DEF( nip, 1, 2, 1, none) /* a b -> b */
@@ -120,6 +117,7 @@ DEF( regexp, 1, 2, 1, none) /* create a RegExp object from the pattern a
120117
bytecode string */
121118
DEF( get_super_ctor, 1, 1, 1, none)
122119
DEF( get_super, 1, 1, 1, none)
120+
DEF( import, 1, 1, 1, none) /* dynamic module import */
123121

124122
DEF( check_var, 5, 0, 1, atom) /* check if a variable exists */
125123
DEF( get_var_undef, 5, 0, 1, atom) /* push undefined if the variable does not exist */

0 commit comments

Comments
 (0)