refactor: allow requiring modules with no side effects (#17496)

This commit is contained in:
Shelley Vohr 2019-04-29 17:46:08 -07:00 committed by Cheng Zhao
parent 4ee201c56e
commit 7b55ee9d36
10 changed files with 85 additions and 54 deletions

10
lib/browser/api/screen.ts Normal file
View 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)