From f276e78e190e04b25c3f05b35a28ecdd30bdcf21 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 21 Nov 2017 17:32:30 +0000 Subject: Clean up CJS_PublicMethods. Change-Id: I0f488814f4345661226cd4f2ce8dc68739d17bb2 Reviewed-on: https://pdfium-review.googlesource.com/18730 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- fxjs/cjs_publicmethods.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'fxjs/cjs_publicmethods.h') diff --git a/fxjs/cjs_publicmethods.h b/fxjs/cjs_publicmethods.h index 95ee4995c9..4088c42f1a 100644 --- a/fxjs/cjs_publicmethods.h +++ b/fxjs/cjs_publicmethods.h @@ -14,10 +14,19 @@ class CJS_PublicMethods : public CJS_Object { public: - explicit CJS_PublicMethods(v8::Local pObject) - : CJS_Object(pObject) {} - ~CJS_PublicMethods() override {} + explicit CJS_PublicMethods(v8::Local pObject); + ~CJS_PublicMethods() override; + static void DefineJSObjects(CFXJS_Engine* pEngine); + static double MakeRegularDate(const WideString& value, + const WideString& format, + bool* bWrongFormat); + + // Exposed for testing. + static WideString MakeFormatDate(double dDate, const WideString& format); + static bool IsNumber(const WideString& str); + + private: static CJS_Return AFNumber_Format( CJS_Runtime* pRuntime, const std::vector>& params); @@ -129,25 +138,18 @@ class CJS_PublicMethods : public CJS_Object { const v8::FunctionCallbackInfo& info); static const JSMethodSpec GlobalFunctionSpecs[]; - static void DefineJSObjects(CFXJS_Engine* pEngine); static int ParseStringInteger(const WideString& string, size_t nStart, - size_t& nSkip, + size_t* pSkip, size_t nMaxStep); static WideString ParseStringString(const WideString& string, size_t nStart, - size_t& nSkip); - static double MakeRegularDate(const WideString& value, - const WideString& format, - bool* bWrongFormat); - static WideString MakeFormatDate(double dDate, const WideString& format); + size_t* pSkip); static double ParseNormalDate(const WideString& value, bool* bWrongFormat); static double MakeInterDate(const WideString& value); - static bool IsNumber(const WideString& str); - - static bool maskSatisfied(wchar_t c_Change, wchar_t c_Mask); - static bool isReservedMaskChar(wchar_t ch); + static bool MaskSatisfied(wchar_t c_Change, wchar_t c_Mask); + static bool IsReservedMaskChar(wchar_t ch); static double AF_Simple(const wchar_t* sFuction, double dValue1, -- cgit v1.2.3