summaryrefslogtreecommitdiff
path: root/fxjs/cjs_publicmethods.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-21 17:32:30 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 17:32:30 +0000
commitf276e78e190e04b25c3f05b35a28ecdd30bdcf21 (patch)
tree65c7e121781800218b3f7c397aae918f0c394880 /fxjs/cjs_publicmethods.h
parent2297ec2274f3ab56741d3c11a09cef6d237a04d4 (diff)
downloadpdfium-f276e78e190e04b25c3f05b35a28ecdd30bdcf21.tar.xz
Clean up CJS_PublicMethods.
Change-Id: I0f488814f4345661226cd4f2ce8dc68739d17bb2 Reviewed-on: https://pdfium-review.googlesource.com/18730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxjs/cjs_publicmethods.h')
-rw-r--r--fxjs/cjs_publicmethods.h30
1 files changed, 16 insertions, 14 deletions
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<v8::Object> pObject)
- : CJS_Object(pObject) {}
- ~CJS_PublicMethods() override {}
+ explicit CJS_PublicMethods(v8::Local<v8::Object> 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<v8::Local<v8::Value>>& params);
@@ -129,25 +138,18 @@ class CJS_PublicMethods : public CJS_Object {
const v8::FunctionCallbackInfo<v8::Value>& 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,