From b2b1f55214688d5e3bfd5015e0a4829d2f314c27 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 29 Aug 2018 19:24:39 +0000 Subject: Stop using deprecated V8 APIs in CJS_GlobalArrays. Change-Id: I7ed3037d8d8862787ad7364eb5f55cd22eb879ad Reviewed-on: https://pdfium-review.googlesource.com/41357 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- fxjs/cjs_globalarrays.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fxjs/cjs_globalarrays.cpp b/fxjs/cjs_globalarrays.cpp index a697c18ac6..9cf540e418 100644 --- a/fxjs/cjs_globalarrays.cpp +++ b/fxjs/cjs_globalarrays.cpp @@ -8,10 +8,11 @@ #define GLOBAL_ARRAY(rt, name, ...) \ { \ - const wchar_t* values[] = {__VA_ARGS__}; \ + static const wchar_t* const values[] = {__VA_ARGS__}; \ v8::Local array = (rt)->NewArray(); \ + v8::Local ctx = (rt)->GetIsolate()->GetCurrentContext(); \ for (size_t i = 0; i < FX_ArraySize(values); ++i) \ - array->Set(i, (rt)->NewString(values[i])); \ + array->Set(ctx, i, (rt)->NewString(values[i])).FromJust(); \ (rt)->SetConstArray((name), array); \ (rt)->DefineGlobalConst( \ (name), [](const v8::FunctionCallbackInfo& info) { \ -- cgit v1.2.3