mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: rename node bindings atom => electron (#22176)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user