From 55db09131508cd347c9f84b5ce1904e84e01a60c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 21 Feb 2017 15:26:52 -0800 Subject: Move JS constant tables to single-byte names none are non-ascii characters, so save space. Change-Id: I5e81e8847a2ce4a5ffa3422d2103ffe453036e7c Reviewed-on: https://pdfium-review.googlesource.com/2819 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fxjs/fxjs_v8.cpp | 5 ++--- fxjs/fxjs_v8.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'fxjs') diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index f876f8c53f..1f049a0dd3 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -315,14 +315,13 @@ void CFXJS_Engine::DefineObjAllProperties( } void CFXJS_Engine::DefineObjConst(int nObjDefnID, - const wchar_t* sConstName, + const char* sConstName, v8::Local pDefault) { v8::Isolate::Scope isolate_scope(m_isolate); v8::HandleScope handle_scope(m_isolate); - CFX_ByteString bsConstName = FX_UTF8Encode(CFX_WideStringC(sConstName)); CFXJS_ObjDefinition* pObjDef = CFXJS_ObjDefinition::ForID(m_isolate, nObjDefnID); - pObjDef->GetInstanceTemplate()->Set(m_isolate, bsConstName.c_str(), pDefault); + pObjDef->GetInstanceTemplate()->Set(m_isolate, sConstName, pDefault); } void CFXJS_Engine::DefineGlobalMethod(const char* sMethodName, diff --git a/fxjs/fxjs_v8.h b/fxjs/fxjs_v8.h index 34e299b4e2..8283184e47 100644 --- a/fxjs/fxjs_v8.h +++ b/fxjs/fxjs_v8.h @@ -160,7 +160,7 @@ class CFXJS_Engine { v8::NamedPropertySetterCallback pPropPut, v8::NamedPropertyDeleterCallback pPropDel); void DefineObjConst(int nObjDefnID, - const wchar_t* sConstName, + const char* sConstName, v8::Local pDefault); void DefineGlobalMethod(const char* sMethodName, v8::FunctionCallback pMethodCall); -- cgit v1.2.3