Skip to content

Commit 9d5243b

Browse files
author
llgoer
committed
更新到2019-08-10版本
1 parent 7c262fb commit 9d5243b

25 files changed

+2246
-518
lines changed

Changelog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2019-08-10:
2+
3+
- added public class fields and private class fields, methods and
4+
accessors (TC39 proposal)
5+
- changed JS_ToCStringLen() prototype
6+
- qjsc: handle '-' in module names and modules with the same filename
7+
- added std.urlGet
8+
- exported JS_GetOwnPropertyNames() and JS_GetOwnProperty()
9+
- exported some bigint C functions
10+
- added support for eshost in run-test262
11+
- misc bug fixes
12+
113
2019-07-28:
214

315
- added dynamic import

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ QuickJS Javascript引擎
1818
* [2.6 Test262 (ECMAScript测试套件)](#26-test262-ecmascript-测试套件)
1919
* [3 技术规范](#3-技术规范)
2020
* [3.1 语言支持](#31-语言支持)
21-
* [3.1.1 ES2020支持](#311-es2020支持)
21+
* [3.1.1 ES2019支持](#311-es2019支持)
2222
* [3.1.2 JSON](#312-json)
2323
* [3.1.3 ECMA402](#313-ecma402)
2424
* [3.1.4 扩展](#314-扩展)
@@ -60,7 +60,7 @@ QuickJS Javascript引擎
6060
1 简介
6161
--------------
6262

63-
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。
63+
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2019规范,包括模块,异步生成器和代理器。
6464

6565
它可选支持数学扩展,例如大整数 (BigInt),大浮点数 (BigFloat) 以及运算符重载。
6666

@@ -78,7 +78,7 @@ QuickJS QQ群:**598609506**。
7878

7979
* 轻量而且易于嵌入:只需几个C文件,没有外部依赖,一个x86下的简单的“hello world”程序只要180 KiB。
8080
* 具有极低启动时间的快速解释器: 在一台单核的台式PC上,大约在100秒内运行ECMAScript 测试套件[1](#FOOT1) 56000次。运行时实例的完整生命周期在不到300微秒的时间内完成。
81-
* 几乎完整实现ES2020支持,包括: 模块,异步生成器和和完整Annex B支持 (传统的Web兼容性)。
81+
* 几乎完整实现ES2019支持,包括: 模块,异步生成器和和完整Annex B支持 (传统的Web兼容性)。
8282
* 通过100%的ECMAScript Test Suite测试。
8383
* 可以将Javascript源编译为没有外部依赖的可执行文件。
8484
* 使用引用计数(以减少内存使用并具有确定性行为)的垃圾收集与循环删除。
@@ -262,9 +262,9 @@ make test2
262262

263263
### 3.1 语言支持
264264

265-
#### 3.1.1 ES2020支持
265+
#### 3.1.1 ES2019支持
266266

267-
包含Annex B (遗留Web兼容)和Unicode相关功能的ES2020规范 [2](#FOOT2) 已经基本支持。 目前尚未支持以下功能:
267+
包含Annex B (遗留Web兼容)和Unicode相关功能的ES2019规范 [2](#FOOT2) 已经基本支持。 目前尚未支持以下功能:
268268

269269
* Realms (尽管C API支持不同的运行时和上下文)
270270
* Tail calls[3](#FOOT3)
@@ -718,7 +718,7 @@ In both cases (32 or 64 bits), JSValue exactly fits two CPU registers, so it can
718718

719719
### 4.4 RegExp
720720

721-
开发了一个特定的正则表达式引擎。它既小又高效,并支持所有ES2020功能,包括Unicode属性。作为Javascript编译器,它直接生成没有解析树的字节码。
721+
开发了一个特定的正则表达式引擎。它既小又高效,并支持所有ES2019功能,包括Unicode属性。作为Javascript编译器,它直接生成没有解析树的字节码。
722722

723723
使用显式堆栈的回溯使得系统堆栈上没有递归。简单的量化器经过专门优化,以避免递归。
724724

TODO

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ Optimizations:
5151

5252
Extensions:
5353
- support more features in [features] section
54-
- add TC39 stage 3 proposals: String.prototype.matchAll, Symbol.matchAll
55-
- fix preprocessor bug if nested #ifdef in jscompress.c
5654
- add built-in preprocessor in compiler, get rid of jscompress
5755
handle #if, #ifdef, #line, limited support for #define
5856
- limited support for web assembly
@@ -76,6 +74,8 @@ REPL:
7674
- close all predefined methods in repl.js and jscalc.js
7775

7876
Test262o: 0/11262 errors, 463 excluded
79-
Test262: 33/58145 errors, 785 excluded, 5576 skipped
80-
Test262bn: 39/60250 errors, 718 excluded, 4587 skipped
81-
test262 commit: 2ee3864136747ee69401b2d266e234cdd0a95965
77+
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
78+
79+
Test262: 27/66629 errors, 784 excluded, 1406 skipped
80+
Test262bn: 27/68730 errors, 717 excluded, 419 skipped
81+
test262 commit: 8f5f6a1aa1a99640483d067f84fcf7719d9e6c38

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2019-07-28
1+
2019-08-10

doc/quickjs.html

+83-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/quickjs.pdf

4.92 KB
Binary file not shown.

doc/quickjs.texi

+67-15
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
@chapter Introduction
2121

2222
QuickJS is a small and embeddable Javascript engine. It supports the
23-
ES2020 specification including modules, asynchronous
24-
generators and proxies.
23+
ES2019 specification
24+
@footnote{@url{https://www.ecma-international.org/ecma-262/10.0}}
25+
including modules, asynchronous generators and proxies.
2526

2627
It optionally supports mathematical extensions such as big integers
2728
(BigInt), big floating point numbers (BigFloat) and operator
@@ -33,12 +34,14 @@ overloading.
3334

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

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.
37+
@item Fast interpreter with very low startup time: runs the 69000 tests of the ECMAScript Test Suite@footnote{@url{https://github.com/tc39/test262}} in about 95 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
3738

38-
@item Almost complete ES2020 support including modules, asynchronous
39-
generators and full Annex B support (legacy web compatibility).
39+
@item Almost complete ES2019 support including modules, asynchronous
40+
generators and full Annex B support (legacy web compatibility). Many
41+
features from the upcoming ES2020 specification
42+
@footnote{@url{https://tc39.github.io/ecma262/}} are also supported.
4043

41-
@item Passes nearly 100% of the ECMAScript Test Suite tests.
44+
@item Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2019 features.
4245

4346
@item Can compile Javascript sources to executables with no external dependency.
4447

@@ -221,21 +224,48 @@ The tests can be run with
221224
make test2
222225
@end example
223226

224-
For more information, run @code{./run-test262} to see the options of
225-
the test262 runner. The configuration files @code{test262.conf} and
226-
@code{test262bn.conf} contain the options to run the various tests.
227+
The configuration files @code{test262.conf} (resp
228+
@code{test262bn.conf} for the bignum version, @code{test262o.conf} for
229+
the old ES5.1 tests@footnote{The old ES5.1 tests can be extracted with
230+
@code{git clone --single-branch --branch es5-tests
231+
https://github.com/tc39/test262.git test262o}})) contain the options
232+
to run the various tests. Tests can be excluded based on features or
233+
filename.
234+
235+
The file @code{test262_errors.txt} contains the current list of
236+
errors. The runner displays a message when a new error appears or when
237+
an existing error is corrected or modified. Use the @code{-u} option
238+
to update the current list of errors (or @code{make test2-update}).
239+
240+
The file @code{test262_report.txt} contains the logs of all the
241+
tests. It is useful to have a clearer analysis of a particular
242+
error. In case of crash, the last line corresponds to the failing
243+
test.
244+
245+
Use the syntax @code{./run-test262 -c test262.conf -f filename.js} to
246+
run a single test. Use the syntax @code{./run-test262 -c test262.conf
247+
N} to start testing at test number @code{N}.
248+
249+
For more information, run @code{./run-test262} to see the command line
250+
options of the test262 runner.
251+
252+
@code{run-test262} accepts the @code{-N} option to be invoked from
253+
@code{test262-harness}@footnote{@url{https://github.com/bterlson/test262-harness}}
254+
thru @code{eshost}. Unless you want to compare QuickJS with other
255+
engines under the same conditions, we do not recommend to run the
256+
tests this way as it is much slower (typically more than one hour
257+
instead of about 100 seconds).
227258

228259
@chapter Specifications
229260

230261
@section Language support
231262

232-
@subsection ES2020 support
263+
@subsection ES2019 support
233264

234-
The ES2020 specification
235-
@footnote{@url{https://tc39.github.io/ecma262/}} is almost fully
236-
supported including the Annex B (legacy web compatibility) and the
237-
Unicode related features. The following features are not supported
238-
yet:
265+
The ES2019 specification is almost fully supported including the Annex
266+
B (legacy web compatibility) and the Unicode related features.
267+
268+
The following features are not supported yet:
239269

240270
@itemize
241271

@@ -399,6 +429,28 @@ useful in case of specific memory constraints or for testing.
399429
Return the value of the environment variable @code{name} or
400430
@code{undefined} if it is not defined.
401431

432+
@item urlGet(url, options = undefined)
433+
434+
Download @code{url} using the @file{curl} command line
435+
utility. @code{options} is an optional object containing the following
436+
optional properties:
437+
438+
@table @code
439+
@item binary
440+
Boolean (default = false). If true, the response is an ArrayBuffer
441+
instead of a string. When a string is returned, the data is assumed
442+
to be UTF-8 encoded.
443+
444+
@item full
445+
Boolean (default = false). If true, return the an object contains
446+
the properties @code{response} (response content),
447+
@code{responseHeaders} (headers separated by CRLF), @code{status}
448+
(status code). If @code{full} is false, only the response is
449+
returned if the status is between 200 and 299. Otherwise an
450+
@code{std.Error} exception is raised.
451+
452+
@end table
453+
402454
@end table
403455

404456
FILE prototype:

0 commit comments

Comments
 (0)