diff options
author | tsepez <tsepez@chromium.org> | 2016-04-15 13:15:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-15 13:15:12 -0700 |
commit | 018935c9304bebf13fbad20b124d775ccae87fae (patch) | |
tree | a8db5b909a5cef43317d924919e7c1be77c505c3 /fpdfsdk/javascript/JS_Value.cpp | |
parent | c3b26b1479824aa5ce745c220a82de7528bc26a9 (diff) | |
download | pdfium-018935c9304bebf13fbad20b124d775ccae87fae.tar.xz |
Pass WideStrings without narrowing to c_str in javascript/
Avoid string duplication when the caller already has one.
Review URL: https://codereview.chromium.org/1883273003
Diffstat (limited to 'fpdfsdk/javascript/JS_Value.cpp')
-rw-r--r-- | fpdfsdk/javascript/JS_Value.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp index 0b31494b75..e2c990c51c 100644 --- a/fpdfsdk/javascript/JS_Value.cpp +++ b/fpdfsdk/javascript/JS_Value.cpp @@ -787,7 +787,7 @@ int JS_GetSecFromTime(double dt) { return (int)_Mod(floor(dt / 1000), 60); } -double JS_DateParse(const wchar_t* str) { +double JS_DateParse(const CFX_WideString& str) { v8::Isolate* pIsolate = v8::Isolate::GetCurrent(); v8::Isolate::Scope isolate_scope(pIsolate); v8::HandleScope scope(pIsolate); @@ -809,7 +809,6 @@ double JS_DateParse(const wchar_t* str) { .ToLocalChecked(); if (v->IsFunction()) { v8::Local<v8::Function> funC = v8::Local<v8::Function>::Cast(v); - const int argc = 1; v8::Local<v8::String> timeStr = FXJS_WSToJSString(pIsolate, str); v8::Local<v8::Value> argv[argc] = {timeStr}; |