Merge pull request #6776 from electron/remove-has-real-name-callback-property-check

Remove HasRealNamedCallbackProperty check when converting objects
This commit is contained in:
Cheng Zhao 2016-08-09 20:26:26 +09:00 committed by GitHub
commit 25f29e30f5
3 changed files with 18 additions and 4 deletions

View file

@ -352,10 +352,6 @@ base::Value* V8ValueConverter::FromV8Object(
continue;
}
// Skip all callbacks: crbug.com/139933
if (val->HasRealNamedCallbackProperty(key->ToString()))
continue;
v8::String::Utf8Value name_utf8(key->ToString());
v8::TryCatch try_catch;

View file

@ -1206,6 +1206,15 @@ describe('browser-window module', function () {
})
w.loadURL(server.url)
})
it('works with result objects that have DOM class prototypes', function (done) {
w.webContents.executeJavaScript('document.location', function (result) {
assert.equal(result.origin, server.url)
assert.equal(result.protocol, 'http:')
done()
})
w.loadURL(server.url)
})
})
describe('offscreen rendering', function () {

View file

@ -294,6 +294,15 @@ describe('ipc module', function () {
})
ipcRenderer.send('message', currentDate)
})
it('can send objects with DOM class prototypes', function (done) {
ipcRenderer.once('message', function (event, value) {
assert.equal(value.protocol, 'file:')
assert.equal(value.hostname, '')
done()
})
ipcRenderer.send('message', document.location)
})
})
describe('ipc.sendSync', function () {