diff options
Diffstat (limited to 'fpdfsdk/javascript/JS_Define.h')
-rw-r--r-- | fpdfsdk/javascript/JS_Define.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h index fb901dc714..f360e8f6b9 100644 --- a/fpdfsdk/javascript/JS_Define.h +++ b/fpdfsdk/javascript/JS_Define.h @@ -173,14 +173,15 @@ void JSMethod(const char* method_name_string, static JSConstSpec ConstSpecs[]; \ static void DefineConsts(CFXJS_Engine* pEngine); -#define IMPLEMENT_JS_CLASS_CONST_PART(js_class_name, class_name) \ - void js_class_name::DefineConsts(CFXJS_Engine* pEngine) { \ - for (size_t i = 0; i < FX_ArraySize(ConstSpecs) - 1; ++i) { \ - pEngine->DefineObjConst(g_nObjDefnID, ConstSpecs[i].pName, \ - ConstSpecs[i].eType == JSConstSpec::Number \ - ? pEngine->NewNumber(ConstSpecs[i].number) \ - : pEngine->NewString(ConstSpecs[i].pStr)); \ - } \ +#define IMPLEMENT_JS_CLASS_CONST_PART(js_class_name, class_name) \ + void js_class_name::DefineConsts(CFXJS_Engine* pEngine) { \ + for (size_t i = 0; i < FX_ArraySize(ConstSpecs) - 1; ++i) { \ + pEngine->DefineObjConst( \ + g_nObjDefnID, ConstSpecs[i].pName, \ + ConstSpecs[i].eType == JSConstSpec::Number \ + ? pEngine->NewNumber(ConstSpecs[i].number).As<v8::Value>() \ + : pEngine->NewString(ConstSpecs[i].pStr).As<v8::Value>()); \ + } \ } // Convenience macros for declaring classes without an alternate. |