Skip to content

Commit

Permalink
Add WeakRef implementation
Browse files Browse the repository at this point in the history
1. Refactor JSObject weak reference list to support different kind of weak reference
2. Support Symbol as WeakMap key
  • Loading branch information
LanderlYoung committed Aug 6, 2024
1 parent 012451d commit 2ecaf6c
Show file tree
Hide file tree
Showing 7 changed files with 371 additions and 60 deletions.
4 changes: 1 addition & 3 deletions doc/quickjs.texi
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ The following features are not supported yet:

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

@item WeakRef and FinalizationRegistry objects

@item Symbols as WeakMap keys
@item FinalizationRegistry objects

@end itemize

Expand Down
1 change: 1 addition & 0 deletions qjsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static const FeatureEntry feature_list[] = {
#define FE_MODULE_LOADER 9
{ "module-loader", NULL },
{ "bigint", "BigInt" },
{ "weakref", "WeakRef" },
};

void namelist_add(namelist_t *lp, const char *name, const char *short_name,
Expand Down
1 change: 1 addition & 0 deletions quickjs-atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,6 @@ DEF(Symbol_asyncIterator, "Symbol.asyncIterator")
#ifdef CONFIG_BIGNUM
DEF(Symbol_operatorSet, "Symbol.operatorSet")
#endif
DEF(WeakRef, "WeakRef")

#endif /* DEF */
Loading

0 comments on commit 2ecaf6c

Please sign in to comment.