electron/spec/fixtures/module/delete-buffer.js

12 lines
303 B
JavaScript
Raw Normal View History

const path = require('path')
2018-09-13 16:10:51 +00:00
const { remote } = require('electron')
const { Buffer } = window
delete window.Buffer
delete global.Buffer
// Test that remote.js doesn't use Buffer global
2018-09-13 16:10:51 +00:00
remote.require(path.join(__dirname, 'print_name.js')).echo(Buffer.from('bar'))
2018-09-13 16:10:51 +00:00
window.test = Buffer.from('buffer')