Skip to content

Commit 279034d

Browse files
committed
Add WeakRef implementation
1. Refactor JSObject weak reference list to support different kind of weak reference 2. Support Symbol as WeakMap key
1 parent 012451d commit 279034d

File tree

7 files changed

+370
-60
lines changed

7 files changed

+370
-60
lines changed

doc/quickjs.texi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ The following features are not supported yet:
281281

282282
@item Tail calls@footnote{We believe the current specification of tails calls is too complicated and presents limited practical interests.}
283283

284-
@item WeakRef and FinalizationRegistry objects
285-
286-
@item Symbols as WeakMap keys
284+
@item FinalizationRegistry objects
287285

288286
@end itemize
289287

qjsc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static const FeatureEntry feature_list[] = {
7777
#define FE_MODULE_LOADER 9
7878
{ "module-loader", NULL },
7979
{ "bigint", "BigInt" },
80+
{ "weakref", "WeakRef" },
8081
};
8182

8283
void namelist_add(namelist_t *lp, const char *name, const char *short_name,

quickjs-atom.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,6 @@ DEF(Symbol_asyncIterator, "Symbol.asyncIterator")
269269
#ifdef CONFIG_BIGNUM
270270
DEF(Symbol_operatorSet, "Symbol.operatorSet")
271271
#endif
272+
DEF(WeakRef, "WeakRef")
272273

273274
#endif /* DEF */

0 commit comments

Comments
 (0)