refactor: allow requiring modules with no side effects (#17496)
This commit is contained in:
parent
4ee201c56e
commit
7b55ee9d36
10 changed files with 85 additions and 54 deletions
10
lib/browser/api/screen.ts
Normal file
10
lib/browser/api/screen.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
'use strict'
|
||||
|
||||
import { createLazyInstance } from '../utils'
|
||||
const { EventEmitter } = require('events')
|
||||
const { Screen, createScreen } = process.electronBinding('screen')
|
||||
|
||||
// Screen is an EventEmitter.
|
||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||
|
||||
module.exports = createLazyInstance(createScreen, Screen, true)
|
Loading…
Add table
Add a link
Reference in a new issue