Make recovering from uncompiled or platform-incompatible native binding possible. #118

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

rngadam commented Nov 6, 2012

Useful if moving the executables from one platform to the other.

@rngadam rngadam Make recovering from uncompiled or
platform-incompatible native binding possible.
6cd72ed
Owner

substack commented Mar 1, 2013

I'm willing to accept try/catch guards around the require('weak') but:

  1. The try/catch guards around require() should happen when the file is loaded so that synchronous io doesn't occur while the server is doing work. Modules should be loaded when the application starts up so that errors show up sooner rather than later.
  2. Printing to console.log() seems spammy.

Something like this might be a better approach:

var canWeak = true;
try { var weak = require('weak') } catch (e) { canWeak = false }
...
if (canWeak && opts.weak !== false && !opts.proto) {
...
Contributor

robcolburn commented Sep 23, 2015

@substack's approach is done in current versions - PR is closable

apsavin closed this Sep 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment