From 4ad801bdc86405888290037065de5d3a3b447167 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 24 Jan 2018 19:45:35 +0000 Subject: Fix broken XFA builds with new V8 These two methods need to be switched to using the maybe versions, since the older versions are being deprecated. BUG=pdfium:989 Change-Id: Id2b48395353af0078e51b2d3ac42103643922320 Reviewed-on: https://pdfium-review.googlesource.com/23830 Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- fxjs/cfxjse_context.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fxjs/cfxjse_context.cpp b/fxjs/cfxjse_context.cpp index 5c85cfd5b1..3ec3b47c14 100644 --- a/fxjs/cfxjse_context.cpp +++ b/fxjs/cfxjse_context.cpp @@ -69,8 +69,12 @@ v8::Local CreateReturnValue(v8::Isolate* pIsolate, hReturnValue->Set(1, hMessage->Get()); } hReturnValue->Set(2, hException); - hReturnValue->Set(3, v8::Integer::New(pIsolate, hMessage->GetLineNumber())); - hReturnValue->Set(4, hMessage->GetSourceLine()); + hReturnValue->Set( + 3, v8::Integer::New( + pIsolate, hMessage->GetLineNumber(pIsolate->GetCurrentContext()) + .FromMaybe(0))); + hReturnValue->Set(4, hMessage->GetSourceLine(pIsolate->GetCurrentContext()) + .FromMaybe(v8::Local())); v8::Maybe maybe_int = hMessage->GetStartColumn(pIsolate->GetCurrentContext()); hReturnValue->Set(5, v8::Integer::New(pIsolate, maybe_int.FromMaybe(0))); -- cgit v1.2.3