chore: rename node bindings atom => electron (#22176)
This commit is contained in:
parent
b5e7df1cbf
commit
602913cb4c
52 changed files with 104 additions and 102 deletions
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
(function () {
|
||||
const asar = process._linkedBinding('atom_common_asar')
|
||||
const v8Util = process._linkedBinding('atom_common_v8_util')
|
||||
const asar = process._linkedBinding('electron_common_asar')
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util')
|
||||
const { Buffer } = require('buffer')
|
||||
const Module = require('module')
|
||||
const path = require('path')
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue