2015-05-19 19:00:06 +08:00
|
|
|
'use strict';
|
2012-06-14 08:39:20 +08:00
|
|
|
var bindings
|
|
|
|
try {
|
|
|
|
bindings = require('../build/Release/weakref.node')
|
|
|
|
} catch (e) {
|
|
|
|
if (e.code === 'MODULE_NOT_FOUND') {
|
|
|
|
bindings = require('../build/Debug/weakref.node')
|
|
|
|
} else {
|
|
|
|
throw e
|
|
|
|
}
|
|
|
|
}
|
2012-06-14 06:55:29 +08:00
|
|
|
module.exports = bindings.create
|
|
|
|
|
|
|
|
// backwards-compat with node-weakref
|
|
|
|
bindings.weaken = bindings.create
|
|
|
|
|
2015-05-19 19:00:06 +08:00
|
|
|
Object.keys(bindings).forEach(function(name) {
|
2012-06-14 06:55:29 +08:00
|
|
|
module.exports[name] = bindings[name]
|
|
|
|
})
|