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

14 lines
328 B
JavaScript
Raw Normal View History

2020-03-20 20:28:31 +00:00
const path = require('path');
const { remote } = require('electron');
const { Buffer } = window;
2020-03-20 20:28:31 +00:00
delete window.Buffer;
delete global.Buffer;
// Test that remote.js doesn't use Buffer global
if (remote) {
remote.require(path.join(__dirname, 'print_name.js')).echo(Buffer.from('bar'));
}
2020-03-20 20:28:31 +00:00
window.test = Buffer.from('buffer');