Skip to content

Commit 7c312df

Browse files
committed
2020-09-06 release
1 parent 8900766 commit 7c312df

26 files changed

+898
-462
lines changed

Changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2020-09-06:
2+
3+
- added logical assignment operators
4+
- added IsHTMLDDA support
5+
- faster for-of loops
6+
- os.Worker now takes a module filename as parameter
7+
- qjsc: added -D option to compile dynamically loaded modules or workers
8+
- misc bug fixes
9+
110
2020-07-05:
211

312
- modified JS_GetPrototype() to return a live value

TODO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ REPL:
7474
Test262o: 0/11262 errors, 463 excluded
7575
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
7676

77-
Test262: 30/71095 errors, 870 excluded, 549 skipped
78-
Test262 commit: 281eb10b2844929a7c0ac04527f5b42ce56509fd
77+
Test262: 30/71748 errors, 868 excluded, 474 skipped
78+
Test262 commit: 24c67328062383079ada85f4d253eb0526fd209b

VERSION

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

cutils.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,30 @@ int unicode_from_utf8(const uint8_t *p, int max_len, const uint8_t **pp)
258258
return c;
259259
}
260260
switch(c) {
261-
case 0xc0 ... 0xdf:
261+
case 0xc0: case 0xc1: case 0xc2: case 0xc3:
262+
case 0xc4: case 0xc5: case 0xc6: case 0xc7:
263+
case 0xc8: case 0xc9: case 0xca: case 0xcb:
264+
case 0xcc: case 0xcd: case 0xce: case 0xcf:
265+
case 0xd0: case 0xd1: case 0xd2: case 0xd3:
266+
case 0xd4: case 0xd5: case 0xd6: case 0xd7:
267+
case 0xd8: case 0xd9: case 0xda: case 0xdb:
268+
case 0xdc: case 0xdd: case 0xde: case 0xdf:
262269
l = 1;
263270
break;
264-
case 0xe0 ... 0xef:
271+
case 0xe0: case 0xe1: case 0xe2: case 0xe3:
272+
case 0xe4: case 0xe5: case 0xe6: case 0xe7:
273+
case 0xe8: case 0xe9: case 0xea: case 0xeb:
274+
case 0xec: case 0xed: case 0xee: case 0xef:
265275
l = 2;
266276
break;
267-
case 0xf0 ... 0xf7:
277+
case 0xf0: case 0xf1: case 0xf2: case 0xf3:
278+
case 0xf4: case 0xf5: case 0xf6: case 0xf7:
268279
l = 3;
269280
break;
270-
case 0xf8 ... 0xfb:
281+
case 0xf8: case 0xf9: case 0xfa: case 0xfb:
271282
l = 4;
272283
break;
273-
case 0xfc ... 0xfd:
284+
case 0xfc: case 0xfd:
274285
l = 5;
275286
break;
276287
default:

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: 18 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/quickjs.pdf

243 Bytes
Binary file not shown.

doc/quickjs.texi

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Load as ES6 script (default=autodetect).
120120

121121
@item --bignum
122122
Enable the bignum extensions: BigDecimal object, BigFloat object and
123-
the @code{"use bigint"} and @code{"use math"} directives.
123+
the @code{"use math"} directive.
124124

125125
@item -I file
126126
@item --include file
@@ -167,6 +167,12 @@ Set the C name of the generated data.
167167
@item -m
168168
Compile as Javascript module (default=autodetect).
169169

170+
@item -D module_name
171+
Compile a dynamically loaded module and its dependencies. This option
172+
is needed when your code uses the @code{import} keyword or the
173+
@code{os.Worker} constructor because the compiler cannot statically
174+
find the name of the dynamically loaded modules.
175+
170176
@item -M module_name[,cname]
171177
Add initialization code for an external C module. See the
172178
@code{c_module} example.
@@ -184,7 +190,7 @@ Disable selected language features to produce a smaller executable file.
184190

185191
@item -fbignum
186192
Enable the bignum extensions: BigDecimal object, BigFloat object and
187-
the @code{"use bigint"} and @code{"use math"} directives.
193+
the @code{"use math"} directive.
188194

189195
@end table
190196

@@ -764,13 +770,14 @@ Cancel a timer.
764770
Return a string representing the platform: @code{"linux"}, @code{"darwin"},
765771
@code{"win32"} or @code{"js"}.
766772

767-
@item Worker(source)
773+
@item Worker(module_filename)
768774
Constructor to create a new thread (worker) with an API close to the
769-
@code{WebWorkers}. @code{source} is a string containing the module
770-
source which is executed in the newly created thread. Threads normally
771-
don't share any data and communicate between each other with
772-
messages. Nested workers are not supported. An example is available in
773-
@file{tests/test_worker.js}.
775+
@code{WebWorkers}. @code{module_filename} is a string specifying the
776+
module filename which is executed in the newly created thread. As for
777+
dynamically imported module, it is relative to the current script or
778+
module path. Threads normally don't share any data and communicate
779+
between each other with messages. Nested workers are not supported. An
780+
example is available in @file{tests/test_worker.js}.
774781

775782
The worker class has the following static properties:
776783

libregexp.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ int lre_parse_escape(const uint8_t **pp, int allow_utf16)
569569
}
570570
}
571571
break;
572-
case '0' ... '7':
572+
case '0': case '1': case '2': case '3':
573+
case '4': case '5': case '6': case '7':
573574
c -= '0';
574575
if (allow_utf16 == 2) {
575576
/* only accept \0 not followed by digit */
@@ -1410,7 +1411,9 @@ static int re_parse_term(REParseState *s, BOOL is_backward_dir)
14101411
}
14111412
}
14121413
goto normal_char;
1413-
case '1' ... '9':
1414+
case '1': case '2': case '3': case '4':
1415+
case '5': case '6': case '7': case '8':
1416+
case '9':
14141417
{
14151418
const uint8_t *q = ++p;
14161419

@@ -1434,7 +1437,7 @@ static int re_parse_term(REParseState *s, BOOL is_backward_dir)
14341437
}
14351438
goto normal_char;
14361439
}
1437-
return re_parse_error(s, "back reference out of range in reguar expression");
1440+
return re_parse_error(s, "back reference out of range in regular expression");
14381441
}
14391442
emit_back_reference:
14401443
last_atom_start = s->byte_code.size;
@@ -2533,6 +2536,17 @@ int lre_get_flags(const uint8_t *bc_buf)
25332536
return bc_buf[RE_HEADER_FLAGS];
25342537
}
25352538

2539+
/* Return NULL if no group names. Otherwise, return a pointer to
2540+
'capture_count - 1' zero terminated UTF-8 strings. */
2541+
const char *lre_get_groupnames(const uint8_t *bc_buf)
2542+
{
2543+
uint32_t re_bytecode_len;
2544+
if ((lre_get_flags(bc_buf) & LRE_FLAG_NAMED_GROUPS) == 0)
2545+
return NULL;
2546+
re_bytecode_len = get_u32(bc_buf + 3);
2547+
return (const char *)(bc_buf + 7 + re_bytecode_len);
2548+
}
2549+
25362550
#ifdef TEST
25372551

25382552
BOOL lre_check_stack_overflow(void *opaque, size_t alloca_size)

0 commit comments

Comments
 (0)