From 018935c9304bebf13fbad20b124d775ccae87fae Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 15 Apr 2016 13:15:12 -0700 Subject: 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 --- fpdfsdk/javascript/JS_Value.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fpdfsdk/javascript/JS_Value.cpp') 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 funC = v8::Local::Cast(v); - const int argc = 1; v8::Local timeStr = FXJS_WSToJSString(pIsolate, str); v8::Local argv[argc] = {timeStr}; -- cgit v1.2.3