Skip to content

Commit

Permalink
Add abstract jobs for FinalizationGroup and WeakRef
Browse files Browse the repository at this point in the history
Implement processing model changes from tc39/proposal-weakrefs#86
Cleanup jobs and clear kept objects tasks are now properly enqueued
Avoid iterating over non-empty cells when cleaning a group
Spec change: cleanupSome no longer invokes callback if no empty cells
  • Loading branch information
mhofman committed May 7, 2019
1 parent 68fca44 commit 86a7b28
Show file tree
Hide file tree
Showing 23 changed files with 674 additions and 608 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"runtimeArgs": [
"--expose-gc",
"--require", "esm",
"--require", "${workspaceFolder}/tests/setup.node.js",
"--require", "${workspaceFolder}/tests/setup.node.cjs",
],
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
Expand Down
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ function testKnownImplementationIssues(
try {
const finalizationGroup = new FinalizationGroup(() => {});
if (finalizationGroup.unregister({}) !== false) return false;
let called = false;
finalizationGroup.cleanupSome(() => {
called = true;
});
if (!called) return false;
// TBD: Figure out how to test for broken cleanupSome
// let called = false;
// finalizationGroup.cleanupSome(() => {
// called = true;
// });
// if (!called) return false;
} catch (err) {
return false;
}
Expand Down
32 changes: 0 additions & 32 deletions src/internal/Agent.mock.ts

This file was deleted.

121 changes: 0 additions & 121 deletions src/internal/Agent.test.ts

This file was deleted.

146 changes: 0 additions & 146 deletions src/internal/Agent.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/internal/AgentFinalizationJobScheduler.ts

This file was deleted.

Loading

0 comments on commit 86a7b28

Please sign in to comment.