Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail test at 'should invoke *all* callbacks from different weak references' #9

Open
Mingyiz opened this issue Aug 15, 2018 · 0 comments

Comments

@Mingyiz
Copy link

Mingyiz commented Aug 15, 2018

Node version 10.8.0
platform windows 7 x64

when i run npm test, segment fault cause the mocha test failed.

the error happend at test/callback.js line 64

it('should invoke *all* callbacks from different weak references',
   function(done) {
  let obj = {};
  const r1 = weak(obj);
  const r2 = weak(obj);
  assert.strictEqual(weak.get(r1), obj);
  assert.strictEqual(weak.isDead(r1), false);
  obj = null;
  let called1 = false;
  let called2 = false;
  weak.addCallback(r1, function() {
    called1 = true
  });
  weak.addCallback(r2, function() {
    called2 = true
  });
  gc();
  setImmediate(() => {
    assert.strictEqual(weak.get(r1), undefined);   // <<-- Here segment fault
    assert.strictEqual(weak.isDead(r1), true);
    assert(called1);
    assert(called2);
    done();
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant