2019-06-08 10:59:53 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
module.exports = function atomBindingSetup (binding, processType) {
|
|
|
|
return function atomBinding (name) {
|
|
|
|
try {
|
|
|
|
return binding(`atom_${processType}_${name}`)
|
|
|
|
} catch (error) {
|
|
|
|
if (/No such module/.test(error.message)) {
|
|
|
|
return binding(`atom_common_${name}`)
|
|
|
|
} else {
|
|
|
|
throw error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-06 20:27:58 +00:00
|
|
|
}
|