chore: rename node bindings atom => electron (#22176)

This commit is contained in:
Jeremy Apthorp 2020-02-14 03:25:39 -08:00 committed by GitHub
parent b5e7df1cbf
commit 602913cb4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 104 additions and 102 deletions

View file

@ -1,10 +1,10 @@
export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] {
return function electronBinding (name: string) {
try {
return binding(`atom_${processType}_${name}`)
return binding(`electron_${processType}_${name}`)
} catch (error) {
if (/No such module/.test(error.message)) {
return binding(`atom_common_${name}`)
return binding(`electron_common_${name}`)
} else {
throw error
}