Skip to content

Commit 10df7db

Browse files
committed
Update QuickJS to 2020-09-06
Update godot to 3.2.3-stable for github action
1 parent ea56ec1 commit 10df7db

File tree

9 files changed

+645
-329
lines changed

9 files changed

+645
-329
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push]
44

55
# Global Cache Settings
66
env:
7-
GODOT_BASE_BRANCH: '3.2.2-stable'
7+
GODOT_BASE_BRANCH: '3.2.3-stable'
88
BASE_BRANCH: master
99
SCONS_CACHE_LIMIT: 4096
1010

quickjs/quickjs/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:

quickjs/quickjs/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)

quickjs/quickjs/libregexp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ uint8_t *lre_compile(int *plen, char *error_msg, int error_msg_size,
4444
void *opaque);
4545
int lre_get_capture_count(const uint8_t *bc_buf);
4646
int lre_get_flags(const uint8_t *bc_buf);
47+
const char *lre_get_groupnames(const uint8_t *bc_buf);
4748
int lre_exec(uint8_t **capture,
4849
const uint8_t *bc_buf, const uint8_t *cbuf, int cindex, int clen,
4950
int cbuf_type, void *opaque);

quickjs/quickjs/libunicode.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,15 +527,22 @@ static int unicode_decomp_entry(uint32_t *res, uint32_t c,
527527
} else {
528528
d = unicode_decomp_data + unicode_decomp_table2[idx];
529529
switch(type) {
530-
case DECOMP_TYPE_L1 ... DECOMP_TYPE_L7:
530+
case DECOMP_TYPE_L1:
531+
case DECOMP_TYPE_L2:
532+
case DECOMP_TYPE_L3:
533+
case DECOMP_TYPE_L4:
534+
case DECOMP_TYPE_L5:
535+
case DECOMP_TYPE_L6:
536+
case DECOMP_TYPE_L7:
531537
l = type - DECOMP_TYPE_L1 + 1;
532538
d += (c - code) * l * 2;
533539
for(i = 0; i < l; i++) {
534540
if ((res[i] = unicode_get16(d + 2 * i)) == 0)
535541
return 0;
536542
}
537543
return l;
538-
case DECOMP_TYPE_LL1 ... DECOMP_TYPE_LL2:
544+
case DECOMP_TYPE_LL1:
545+
case DECOMP_TYPE_LL2:
539546
{
540547
uint32_t k, p;
541548
l = type - DECOMP_TYPE_LL1 + 1;
@@ -551,7 +558,11 @@ static int unicode_decomp_entry(uint32_t *res, uint32_t c,
551558
}
552559
}
553560
return l;
554-
case DECOMP_TYPE_S1 ... DECOMP_TYPE_S5:
561+
case DECOMP_TYPE_S1:
562+
case DECOMP_TYPE_S2:
563+
case DECOMP_TYPE_S3:
564+
case DECOMP_TYPE_S4:
565+
case DECOMP_TYPE_S5:
555566
l = type - DECOMP_TYPE_S1 + 1;
556567
d += (c - code) * l;
557568
for(i = 0; i < l; i++) {
@@ -582,7 +593,14 @@ static int unicode_decomp_entry(uint32_t *res, uint32_t c,
582593
case DECOMP_TYPE_B18:
583594
l = 18;
584595
goto decomp_type_b;
585-
case DECOMP_TYPE_B1 ... DECOMP_TYPE_B8:
596+
case DECOMP_TYPE_B1:
597+
case DECOMP_TYPE_B2:
598+
case DECOMP_TYPE_B3:
599+
case DECOMP_TYPE_B4:
600+
case DECOMP_TYPE_B5:
601+
case DECOMP_TYPE_B6:
602+
case DECOMP_TYPE_B7:
603+
case DECOMP_TYPE_B8:
586604
l = type - DECOMP_TYPE_B1 + 1;
587605
decomp_type_b:
588606
{

quickjs/quickjs/quickjs-opcode.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ DEF( call3, 1, 1, 1, npopx)
359359

360360
DEF( is_undefined, 1, 1, 1, none)
361361
DEF( is_null, 1, 1, 1, none)
362-
DEF( is_function, 1, 1, 1, none)
362+
DEF(typeof_is_undefined, 1, 1, 1, none)
363+
DEF( typeof_is_function, 1, 1, 1, none)
363364
#endif
364365

365366
#undef DEF

0 commit comments

Comments
 (0)