chore: rename atom-binding-setup.ts to electron-binding-setup.ts (#17949)
This commit is contained in:
parent
6f83977f47
commit
18b77a4de6
7 changed files with 8 additions and 8 deletions
13
lib/common/electron-binding-setup.ts
Normal file
13
lib/common/electron-binding-setup.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
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}`)
|
||||
} catch (error) {
|
||||
if (/No such module/.test(error.message)) {
|
||||
return binding(`atom_common_${name}`)
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue