Skip to content

rhalff/fragile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fragile

This is a fragile weak implementation which can be used in node.js and v8 based browsers.

In able to run this code you should use the v8 expose-gc and allow-natives-syntax flags.

Chrom(e|ium):

chromium-browser --js-flags="--expose-gc --allow-natives-syntax"

Node.js:

node --expose_gc --allow_natives_syntax

Usage:

Referenced:

const fragile = require('fragile')

let myObject = {be: 'test'};

const myObjectIsLeaking = fragile(myObject)

myObjectIsLeaking() // true

Dereferenced:

const fragile = require('fragile')

let myObject = {be: 'test'};

const myObjectIsLeaking = fragile(myObject)

myObject = null

myObjectIsLeaking() // false

About

A fragile `weak` implementation for v8.

Resources

Stars

Watchers

Forks

Packages

No packages published