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

12 lines
310 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
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');