Avoid line number assertion in V8

This commit is contained in:
Marshall Greenblatt 2016-11-01 19:04:51 -04:00
parent b34508375a
commit 3f66e81a78

View File

@ -240,8 +240,12 @@ void CefFrameHostImpl::SendJavaScript(
int startLine) {
if (jsCode.empty())
return;
if (startLine < 0)
startLine = 0;
if (startLine <= 0) {
// A value of 0 is v8::Message::kNoLineNumberInfo in V8. There is code in
// V8 that will assert on that value (e.g. V8StackTraceImpl::Frame::Frame
// if a JS exception is thrown) so make sure |startLine| > 0.
startLine = 1;
}
CefRefPtr<CefBrowserHostImpl> browser;
int64 frame_id;