summaryrefslogtreecommitdiff
path: root/fxjs/js_define.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-06 20:51:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-06 20:51:04 +0000
commit6ffd840c1f4d7d74a6c4c07c5791c4f3db8d50b9 (patch)
tree1020d5547830ef16b52648818232c69c65850cdf /fxjs/js_define.cpp
parent222d3fdf687554b298650080e2e8f47d83411651 (diff)
downloadpdfium-6ffd840c1f4d7d74a6c4c07c5791c4f3db8d50b9.tar.xz
Remove still more v8::Context slot usage.chromium/3452
Removes CJS_Runtime::RuntimeFromIsolateCurrentContext() Change-Id: I51abcf32aaafac522e1595edf663507c26781357 Reviewed-on: https://pdfium-review.googlesource.com/34230 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/js_define.cpp')
-rw-r--r--fxjs/js_define.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fxjs/js_define.cpp b/fxjs/js_define.cpp
index 3e14a3dd1d..124fd91651 100644
--- a/fxjs/js_define.cpp
+++ b/fxjs/js_define.cpp
@@ -236,8 +236,10 @@ double JS_DateParse(const WideString& str) {
v8::Local<v8::Function> funC = v8::Local<v8::Function>::Cast(v);
const int argc = 1;
v8::Local<v8::Value> timeStr =
- CJS_Runtime::RuntimeFromIsolateCurrentContext(pIsolate)->NewString(
- str.AsStringView());
+ v8::String::NewFromUtf8(pIsolate,
+ FX_UTF8Encode(str.AsStringView()).c_str(),
+ v8::NewStringType::kNormal)
+ .ToLocalChecked();
v8::Local<v8::Value> argv[argc] = {timeStr};
v = funC->Call(context, context->Global(), argc, argv).ToLocalChecked();
if (v->IsNumber()) {