fix: ipcRemote.sendSync regression after moving away from JSON for return values (#13941)
This commit is contained in:
parent
a7052efaf4
commit
9a1ad2b93f
4 changed files with 5 additions and 2 deletions
|
@ -3,7 +3,6 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const {send, sendSync} = binding
|
const {send, sendSync} = binding
|
||||||
const {parse} = JSON
|
|
||||||
|
|
||||||
const ipcRenderer = {
|
const ipcRenderer = {
|
||||||
send (...args) {
|
send (...args) {
|
||||||
|
@ -11,7 +10,7 @@ const ipcRenderer = {
|
||||||
},
|
},
|
||||||
|
|
||||||
sendSync (...args) {
|
sendSync (...args) {
|
||||||
return parse(sendSync('ipc-message-sync', args))
|
return sendSync('ipc-message-sync', args)[0]
|
||||||
},
|
},
|
||||||
|
|
||||||
// No-ops since events aren't received
|
// No-ops since events aren't received
|
||||||
|
|
|
@ -3120,6 +3120,7 @@ describe('BrowserWindow module', () => {
|
||||||
typeofFunctionApply: 'function'
|
typeofFunctionApply: 'function'
|
||||||
},
|
},
|
||||||
pageContext: {
|
pageContext: {
|
||||||
|
openedLocation: '',
|
||||||
preloadProperty: 'undefined',
|
preloadProperty: 'undefined',
|
||||||
pageProperty: 'string',
|
pageProperty: 'string',
|
||||||
typeofRequire: 'undefined',
|
typeofRequire: 'undefined',
|
||||||
|
|
2
spec/fixtures/api/isolated.html
vendored
2
spec/fixtures/api/isolated.html
vendored
|
@ -9,9 +9,11 @@
|
||||||
Function.prototype.apply = true
|
Function.prototype.apply = true
|
||||||
|
|
||||||
const opened = window.open()
|
const opened = window.open()
|
||||||
|
const openedLocation = opened.location
|
||||||
opened.close()
|
opened.close()
|
||||||
|
|
||||||
window.postMessage({
|
window.postMessage({
|
||||||
|
openedLocation,
|
||||||
preloadProperty: typeof window.foo,
|
preloadProperty: typeof window.foo,
|
||||||
pageProperty: typeof window.hello,
|
pageProperty: typeof window.hello,
|
||||||
typeofRequire: typeof require,
|
typeofRequire: typeof require,
|
||||||
|
|
|
@ -544,6 +544,7 @@ describe('<webview> tag', function () {
|
||||||
typeofFunctionApply: 'function'
|
typeofFunctionApply: 'function'
|
||||||
},
|
},
|
||||||
pageContext: {
|
pageContext: {
|
||||||
|
openedLocation: '',
|
||||||
preloadProperty: 'undefined',
|
preloadProperty: 'undefined',
|
||||||
pageProperty: 'string',
|
pageProperty: 'string',
|
||||||
typeofRequire: 'undefined',
|
typeofRequire: 'undefined',
|
||||||
|
|
Loading…
Reference in a new issue