summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-12 01:53:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-12 01:53:28 +0000
commit909fa2daa49e5439c595e3d17a76f0e05d7934b0 (patch)
tree7dac1ee220b8e0968ff42cedf53775b1ca5a62ac
parent5e99d62f4d92531833daeb062073d805bf363df3 (diff)
downloadpdfium-909fa2daa49e5439c595e3d17a76f0e05d7934b0.tar.xz
[js] Convert to using size instead of sentinels
This CL changes the DefineMethod, DefineProps and DefineConsts methods to pass a size instead of depending on a sentinel value in the definition arrays. Change-Id: Ie054544124290c0833a8b21af175a203ca99591a Reviewed-on: https://pdfium-review.googlesource.com/20551 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
-rw-r--r--fxjs/cjs_annot.cpp5
-rw-r--r--fxjs/cjs_app.cpp10
-rw-r--r--fxjs/cjs_border.cpp5
-rw-r--r--fxjs/cjs_color.cpp10
-rw-r--r--fxjs/cjs_console.cpp5
-rw-r--r--fxjs/cjs_display.cpp5
-rw-r--r--fxjs/cjs_document.cpp10
-rw-r--r--fxjs/cjs_event.cpp5
-rw-r--r--fxjs/cjs_field.cpp10
-rw-r--r--fxjs/cjs_font.cpp5
-rw-r--r--fxjs/cjs_global.cpp5
-rw-r--r--fxjs/cjs_highlight.cpp5
-rw-r--r--fxjs/cjs_icon.cpp5
-rw-r--r--fxjs/cjs_object.cpp15
-rw-r--r--fxjs/cjs_object.h9
-rw-r--r--fxjs/cjs_position.cpp5
-rw-r--r--fxjs/cjs_report.cpp8
-rw-r--r--fxjs/cjs_scalehow.cpp5
-rw-r--r--fxjs/cjs_scalewhen.cpp5
-rw-r--r--fxjs/cjs_style.cpp5
-rw-r--r--fxjs/cjs_util.cpp10
-rw-r--r--fxjs/cjs_zoomtype.cpp5
-rw-r--r--fxjs/xfa/cjx_container.cpp5
-rw-r--r--fxjs/xfa/cjx_datawindow.cpp5
-rw-r--r--fxjs/xfa/cjx_delta.cpp5
-rw-r--r--fxjs/xfa/cjx_desc.cpp5
-rw-r--r--fxjs/xfa/cjx_eventpseudomodel.cpp5
-rw-r--r--fxjs/xfa/cjx_exclgroup.cpp5
-rw-r--r--fxjs/xfa/cjx_field.cpp5
-rw-r--r--fxjs/xfa/cjx_form.cpp5
-rw-r--r--fxjs/xfa/cjx_hostpseudomodel.cpp5
-rw-r--r--fxjs/xfa/cjx_instancemanager.cpp5
-rw-r--r--fxjs/xfa/cjx_layoutpseudomodel.cpp5
-rw-r--r--fxjs/xfa/cjx_list.cpp5
-rw-r--r--fxjs/xfa/cjx_logpseudomodel.cpp5
-rw-r--r--fxjs/xfa/cjx_manifest.cpp5
-rw-r--r--fxjs/xfa/cjx_model.cpp5
-rw-r--r--fxjs/xfa/cjx_node.cpp5
-rw-r--r--fxjs/xfa/cjx_object.cpp5
-rw-r--r--fxjs/xfa/cjx_object.h2
-rw-r--r--fxjs/xfa/cjx_packet.cpp5
-rw-r--r--fxjs/xfa/cjx_signaturepseudomodel.cpp5
-rw-r--r--fxjs/xfa/cjx_source.cpp5
-rw-r--r--fxjs/xfa/cjx_subform.cpp5
-rw-r--r--fxjs/xfa/cjx_template.cpp5
-rw-r--r--fxjs/xfa/cjx_tree.cpp5
-rw-r--r--fxjs/xfa/cjx_treelist.cpp5
-rw-r--r--fxjs/xfa/cjx_wsdlconnection.cpp5
48 files changed, 121 insertions, 158 deletions
diff --git a/fxjs/cjs_annot.cpp b/fxjs/cjs_annot.cpp
index 62fdfb8b76..69eccefa27 100644
--- a/fxjs/cjs_annot.cpp
+++ b/fxjs/cjs_annot.cpp
@@ -22,8 +22,7 @@ CPDFSDK_BAAnnot* ToBAAnnot(CPDFSDK_Annot* annot) {
const JSPropertySpec CJS_Annot::PropertySpecs[] = {
{"hidden", get_hidden_static, set_hidden_static},
{"name", get_name_static, set_name_static},
- {"type", get_type_static, set_type_static},
- {0, 0, 0}};
+ {"type", get_type_static, set_type_static}};
int CJS_Annot::ObjDefnID = -1;
@@ -37,7 +36,7 @@ void CJS_Annot::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("Annot", FXJSOBJTYPE_DYNAMIC,
JSConstructor<CJS_Annot, Annot>,
JSDestructor<CJS_Annot>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
}
Annot::Annot(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
diff --git a/fxjs/cjs_app.cpp b/fxjs/cjs_app.cpp
index e89fb2a2c7..32cac22153 100644
--- a/fxjs/cjs_app.cpp
+++ b/fxjs/cjs_app.cpp
@@ -48,8 +48,7 @@ const JSPropertySpec CJS_App::PropertySpecs[] = {
{"viewerType", get_viewer_type_static, set_viewer_type_static},
{"viewerVariation", get_viewer_variation_static,
set_viewer_variation_static},
- {"viewerVersion", get_viewer_version_static, set_viewer_version_static},
- {0, 0, 0}};
+ {"viewerVersion", get_viewer_version_static, set_viewer_version_static}};
const JSMethodSpec CJS_App::MethodSpecs[] = {
{"alert", alert_static},
@@ -72,8 +71,7 @@ const JSMethodSpec CJS_App::MethodSpecs[] = {
{"popUpMenu", popUpMenu_static},
{"response", response_static},
{"setInterval", setInterval_static},
- {"setTimeOut", setTimeOut_static},
- {0, 0}};
+ {"setTimeOut", setTimeOut_static}};
int CJS_App::ObjDefnID = -1;
@@ -82,8 +80,8 @@ void CJS_App::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("app", FXJSOBJTYPE_STATIC, JSConstructor<CJS_App, app>,
JSDestructor<CJS_App>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
app::app(CJS_Object* pJSObject)
diff --git a/fxjs/cjs_border.cpp b/fxjs/cjs_border.cpp
index 24d50ffcad..95693f4c39 100644
--- a/fxjs/cjs_border.cpp
+++ b/fxjs/cjs_border.cpp
@@ -11,8 +11,7 @@ const JSConstSpec CJS_Border::ConstSpecs[] = {
{"b", JSConstSpec::String, 0, "beveled"},
{"d", JSConstSpec::String, 0, "dashed"},
{"i", JSConstSpec::String, 0, "inset"},
- {"u", JSConstSpec::String, 0, "underline"},
- {0, JSConstSpec::Number, 0, 0}};
+ {"u", JSConstSpec::String, 0, "underline"}};
int CJS_Border::ObjDefnID = -1;
@@ -20,5 +19,5 @@ int CJS_Border::ObjDefnID = -1;
void CJS_Border::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("border", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_color.cpp b/fxjs/cjs_color.cpp
index 1bebf79ea8..58a98dd8ff 100644
--- a/fxjs/cjs_color.cpp
+++ b/fxjs/cjs_color.cpp
@@ -26,12 +26,10 @@ const JSPropertySpec CJS_Color::PropertySpecs[] = {
{"red", get_red_static, set_red_static},
{"transparent", get_transparent_static, set_transparent_static},
{"white", get_white_static, set_white_static},
- {"yellow", get_yellow_static, set_yellow_static},
- {0, 0, 0}};
+ {"yellow", get_yellow_static, set_yellow_static}};
const JSMethodSpec CJS_Color::MethodSpecs[] = {{"convert", convert_static},
- {"equal", equal_static},
- {0, 0}};
+ {"equal", equal_static}};
int CJS_Color::ObjDefnID = -1;
@@ -40,8 +38,8 @@ void CJS_Color::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("color", FXJSOBJTYPE_STATIC,
JSConstructor<CJS_Color, color>,
JSDestructor<CJS_Color>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
// static
diff --git a/fxjs/cjs_console.cpp b/fxjs/cjs_console.cpp
index c5e23a3c27..1921cd2069 100644
--- a/fxjs/cjs_console.cpp
+++ b/fxjs/cjs_console.cpp
@@ -16,8 +16,7 @@
const JSMethodSpec CJS_Console::MethodSpecs[] = {{"clear", clear_static},
{"hide", hide_static},
{"println", println_static},
- {"show", show_static},
- {0, 0}};
+ {"show", show_static}};
int CJS_Console::ObjDefnID = -1;
@@ -26,7 +25,7 @@ void CJS_Console::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("console", FXJSOBJTYPE_STATIC,
JSConstructor<CJS_Console, console>,
JSDestructor<CJS_Console>);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
diff --git a/fxjs/cjs_display.cpp b/fxjs/cjs_display.cpp
index a52b51d462..6970bfcb51 100644
--- a/fxjs/cjs_display.cpp
+++ b/fxjs/cjs_display.cpp
@@ -10,8 +10,7 @@ const JSConstSpec CJS_Display::ConstSpecs[] = {
{"visible", JSConstSpec::Number, 0, 0},
{"hidden", JSConstSpec::Number, 1, 0},
{"noPrint", JSConstSpec::Number, 2, 0},
- {"noView", JSConstSpec::Number, 3, 0},
- {0, JSConstSpec::Number, 0, 0}};
+ {"noView", JSConstSpec::Number, 3, 0}};
int CJS_Display::ObjDefnID = -1;
@@ -19,5 +18,5 @@ int CJS_Display::ObjDefnID = -1;
void CJS_Display::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("display", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index 46ece171b0..d4eca2f175 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -61,8 +61,7 @@ const JSPropertySpec CJS_Document::PropertySpecs[] = {
{"title", get_title_static, set_title_static},
{"URL", get_URL_static, set_URL_static},
{"zoom", get_zoom_static, set_zoom_static},
- {"zoomType", get_zoom_type_static, set_zoom_type_static},
- {0, 0, 0}};
+ {"zoomType", get_zoom_type_static, set_zoom_type_static}};
const JSMethodSpec CJS_Document::MethodSpecs[] = {
{"addAnnot", addAnnot_static},
@@ -106,8 +105,7 @@ const JSMethodSpec CJS_Document::MethodSpecs[] = {
{"saveAs", saveAs_static},
{"submitForm", submitForm_static},
{"syncAnnotScan", syncAnnotScan_static},
- {"mailDoc", mailDoc_static},
- {0, 0}};
+ {"mailDoc", mailDoc_static}};
int CJS_Document::ObjDefnID = -1;
@@ -121,8 +119,8 @@ void CJS_Document::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("Document", FXJSOBJTYPE_GLOBAL,
JSConstructor<CJS_Document, Document>,
JSDestructor<CJS_Document>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
void CJS_Document::InitInstance(IJS_Runtime* pIRuntime) {
diff --git a/fxjs/cjs_event.cpp b/fxjs/cjs_event.cpp
index 2d4508a30b..4fb988f4a6 100644
--- a/fxjs/cjs_event.cpp
+++ b/fxjs/cjs_event.cpp
@@ -32,8 +32,7 @@ const JSPropertySpec CJS_Event::PropertySpecs[] = {
{"targetName", get_target_name_static, set_target_name_static},
{"type", get_type_static, set_type_static},
{"value", get_value_static, set_value_static},
- {"willCommit", get_will_commit_static, set_will_commit_static},
- {0, 0, 0}};
+ {"willCommit", get_will_commit_static, set_will_commit_static}};
int CJS_Event::ObjDefnID = -1;
@@ -42,7 +41,7 @@ void CJS_Event::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("event", FXJSOBJTYPE_STATIC,
JSConstructor<CJS_Event, event>,
JSDestructor<CJS_Event>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
}
event::event(CJS_Object* pJsObject) : CJS_EmbedObj(pJsObject) {}
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index cb8eb6bfcb..f2e27f2477 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -124,8 +124,7 @@ const JSPropertySpec CJS_Field::PropertySpecs[] = {
{"userName", get_user_name_static, set_user_name_static},
{"value", get_value_static, set_value_static},
{"valueAsString", get_value_as_string_static, set_value_as_string_static},
- {"source", get_source_static, set_source_static},
- {0, 0, 0}};
+ {"source", get_source_static, set_source_static}};
const JSMethodSpec CJS_Field::MethodSpecs[] = {
{"browseForFileToSubmit", browseForFileToSubmit_static},
@@ -153,8 +152,7 @@ const JSMethodSpec CJS_Field::MethodSpecs[] = {
{"signatureInfo", signatureInfo_static},
{"signatureSetSeedValue", signatureSetSeedValue_static},
{"signatureSign", signatureSign_static},
- {"signatureValidate", signatureValidate_static},
- {0, 0}};
+ {"signatureValidate", signatureValidate_static}};
int CJS_Field::ObjDefnID = -1;
@@ -168,8 +166,8 @@ void CJS_Field::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("Field", FXJSOBJTYPE_DYNAMIC,
JSConstructor<CJS_Field, Field>,
JSDestructor<CJS_Field>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
void CJS_Field::InitInstance(IJS_Runtime* pIRuntime) {}
diff --git a/fxjs/cjs_font.cpp b/fxjs/cjs_font.cpp
index b4ef66b869..54b392f9a7 100644
--- a/fxjs/cjs_font.cpp
+++ b/fxjs/cjs_font.cpp
@@ -20,13 +20,12 @@ const JSConstSpec CJS_Font::ConstSpecs[] = {
{"CourI", JSConstSpec::String, 0, "Courier-Oblique"},
{"CourBI", JSConstSpec::String, 0, "Courier-BoldOblique"},
{"Symbol", JSConstSpec::String, 0, "Symbol"},
- {"ZapfD", JSConstSpec::String, 0, "ZapfDingbats"},
- {0, JSConstSpec::Number, 0, 0}};
+ {"ZapfD", JSConstSpec::String, 0, "ZapfDingbats"}};
int CJS_Font::ObjDefnID = -1;
// static
void CJS_Font::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("font", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index 95124ff84d..23763544f5 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -174,8 +174,7 @@ class JSGlobalAlternate : public CJS_EmbedObj {
} // namespace
const JSMethodSpec CJS_Global::MethodSpecs[] = {
- {"setPersistent", setPersistent_static},
- {0, 0}};
+ {"setPersistent", setPersistent_static}};
int CJS_Global::ObjDefnID = -1;
@@ -227,7 +226,7 @@ void CJS_Global::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("global", FXJSOBJTYPE_STATIC,
JSConstructor<CJS_Global, JSGlobalAlternate>,
JSDestructor<CJS_Global>);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
DefineAllProperties(pEngine);
}
diff --git a/fxjs/cjs_highlight.cpp b/fxjs/cjs_highlight.cpp
index 453a2662fb..e60a5a819e 100644
--- a/fxjs/cjs_highlight.cpp
+++ b/fxjs/cjs_highlight.cpp
@@ -10,8 +10,7 @@ const JSConstSpec CJS_Highlight::ConstSpecs[] = {
{"n", JSConstSpec::String, 0, "none"},
{"i", JSConstSpec::String, 0, "invert"},
{"p", JSConstSpec::String, 0, "push"},
- {"o", JSConstSpec::String, 0, "outline"},
- {0, JSConstSpec::Number, 0, 0}};
+ {"o", JSConstSpec::String, 0, "outline"}};
int CJS_Highlight::ObjDefnID = -1;
@@ -19,5 +18,5 @@ int CJS_Highlight::ObjDefnID = -1;
void CJS_Highlight::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("highlight", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_icon.cpp b/fxjs/cjs_icon.cpp
index c4ef8e1684..2b56f70cdc 100644
--- a/fxjs/cjs_icon.cpp
+++ b/fxjs/cjs_icon.cpp
@@ -7,8 +7,7 @@
#include "fxjs/cjs_icon.h"
const JSPropertySpec CJS_Icon::PropertySpecs[] = {
- {"name", get_name_static, set_name_static},
- {0, 0, 0}};
+ {"name", get_name_static, set_name_static}};
int CJS_Icon::ObjDefnID = -1;
@@ -22,7 +21,7 @@ void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC,
JSConstructor<CJS_Icon, Icon>, JSDestructor<CJS_Icon>);
- DefineProps(pEngine, ObjDefnID, PropertySpecs);
+ DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs));
}
Icon::Icon(CJS_Object* pJSObject)
diff --git a/fxjs/cjs_object.cpp b/fxjs/cjs_object.cpp
index ccddc7f8df..a1e5ce1c94 100644
--- a/fxjs/cjs_object.cpp
+++ b/fxjs/cjs_object.cpp
@@ -9,8 +9,9 @@
// static
void CJS_Object::DefineConsts(CFXJS_Engine* pEngine,
int objId,
- const JSConstSpec consts[]) {
- for (size_t i = 0; consts[i].pName != 0; ++i) {
+ const JSConstSpec consts[],
+ size_t count) {
+ for (size_t i = 0; i < count; ++i) {
pEngine->DefineObjConst(
objId, consts[i].pName,
consts[i].eType == JSConstSpec::Number
@@ -22,8 +23,9 @@ void CJS_Object::DefineConsts(CFXJS_Engine* pEngine,
// static
void CJS_Object::DefineProps(CFXJS_Engine* pEngine,
int objId,
- const JSPropertySpec props[]) {
- for (size_t i = 0; props[i].pName != 0; ++i) {
+ const JSPropertySpec props[],
+ size_t count) {
+ for (size_t i = 0; i < count; ++i) {
pEngine->DefineObjProperty(objId, props[i].pName, props[i].pPropGet,
props[i].pPropPut);
}
@@ -32,8 +34,9 @@ void CJS_Object::DefineProps(CFXJS_Engine* pEngine,
// static
void CJS_Object::DefineMethods(CFXJS_Engine* pEngine,
int objId,
- const JSMethodSpec methods[]) {
- for (size_t i = 0; methods[i].pName != 0; ++i)
+ const JSMethodSpec methods[],
+ size_t count) {
+ for (size_t i = 0; i < count; ++i)
pEngine->DefineObjMethod(objId, methods[i].pName, methods[i].pMethodCall);
}
diff --git a/fxjs/cjs_object.h b/fxjs/cjs_object.h
index bed5088f03..d929a01496 100644
--- a/fxjs/cjs_object.h
+++ b/fxjs/cjs_object.h
@@ -38,13 +38,16 @@ class CJS_Object {
public:
static void DefineConsts(CFXJS_Engine* pEngine,
int objId,
- const JSConstSpec consts[]);
+ const JSConstSpec consts[],
+ size_t count);
static void DefineProps(CFXJS_Engine* pEngine,
int objId,
- const JSPropertySpec props[]);
+ const JSPropertySpec props[],
+ size_t count);
static void DefineMethods(CFXJS_Engine* pEngine,
int objId,
- const JSMethodSpec methods[]);
+ const JSMethodSpec methods[],
+ size_t count);
explicit CJS_Object(v8::Local<v8::Object> pObject);
virtual ~CJS_Object();
diff --git a/fxjs/cjs_position.cpp b/fxjs/cjs_position.cpp
index ba1f3d947c..16e4ab093b 100644
--- a/fxjs/cjs_position.cpp
+++ b/fxjs/cjs_position.cpp
@@ -13,8 +13,7 @@ const JSConstSpec CJS_Position::ConstSpecs[] = {
{"textIconV", JSConstSpec::Number, 3, 0},
{"iconTextH", JSConstSpec::Number, 4, 0},
{"textIconH", JSConstSpec::Number, 5, 0},
- {"overlay", JSConstSpec::Number, 6, 0},
- {0, JSConstSpec::Number, 0, 0}};
+ {"overlay", JSConstSpec::Number, 6, 0}};
int CJS_Position::ObjDefnID = -1;
@@ -22,5 +21,5 @@ int CJS_Position::ObjDefnID = -1;
void CJS_Position::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("position", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_report.cpp b/fxjs/cjs_report.cpp
index 2aa3f49078..0788a90a4c 100644
--- a/fxjs/cjs_report.cpp
+++ b/fxjs/cjs_report.cpp
@@ -11,9 +11,9 @@
#include "fxjs/JS_Define.h"
#include "fxjs/cjs_object.h"
-const JSMethodSpec CJS_Report::MethodSpecs[] = {{"save", save_static},
- {"writeText", writeText_static},
- {0, 0}};
+const JSMethodSpec CJS_Report::MethodSpecs[] = {
+ {"save", save_static},
+ {"writeText", writeText_static}};
int CJS_Report::ObjDefnID = -1;
@@ -22,7 +22,7 @@ void CJS_Report::DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType) {
ObjDefnID =
pEngine->DefineObj("Report", eObjType, JSConstructor<CJS_Report, Report>,
JSDestructor<CJS_Report>);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
diff --git a/fxjs/cjs_scalehow.cpp b/fxjs/cjs_scalehow.cpp
index 35c5ec22bf..762863b686 100644
--- a/fxjs/cjs_scalehow.cpp
+++ b/fxjs/cjs_scalehow.cpp
@@ -8,8 +8,7 @@
const JSConstSpec CJS_ScaleHow::ConstSpecs[] = {
{"proportional", JSConstSpec::Number, 0, 0},
- {"anamorphic", JSConstSpec::Number, 1, 0},
- {0, JSConstSpec::Number, 0, 0}};
+ {"anamorphic", JSConstSpec::Number, 1, 0}};
int CJS_ScaleHow::ObjDefnID = -1;
@@ -17,5 +16,5 @@ int CJS_ScaleHow::ObjDefnID = -1;
void CJS_ScaleHow::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("scaleHow", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_scalewhen.cpp b/fxjs/cjs_scalewhen.cpp
index b13e7ed928..59f04870ca 100644
--- a/fxjs/cjs_scalewhen.cpp
+++ b/fxjs/cjs_scalewhen.cpp
@@ -10,8 +10,7 @@ const JSConstSpec CJS_ScaleWhen::ConstSpecs[] = {
{"always", JSConstSpec::Number, 0, 0},
{"never", JSConstSpec::Number, 1, 0},
{"tooBig", JSConstSpec::Number, 2, 0},
- {"tooSmall", JSConstSpec::Number, 3, 0},
- {0, JSConstSpec::Number, 0, 0}};
+ {"tooSmall", JSConstSpec::Number, 3, 0}};
int CJS_ScaleWhen::ObjDefnID = -1;
@@ -19,5 +18,5 @@ int CJS_ScaleWhen::ObjDefnID = -1;
void CJS_ScaleWhen::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("scaleWhen", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_style.cpp b/fxjs/cjs_style.cpp
index 7458b2a18b..be95e9a501 100644
--- a/fxjs/cjs_style.cpp
+++ b/fxjs/cjs_style.cpp
@@ -12,13 +12,12 @@ const JSConstSpec CJS_Style::ConstSpecs[] = {
{"di", JSConstSpec::String, 0, "diamond"},
{"ci", JSConstSpec::String, 0, "circle"},
{"st", JSConstSpec::String, 0, "star"},
- {"sq", JSConstSpec::String, 0, "square"},
- {0, JSConstSpec::Number, 0, 0}};
+ {"sq", JSConstSpec::String, 0, "square"}};
int CJS_Style::ObjDefnID = -1;
// static
void CJS_Style::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID = pEngine->DefineObj("style", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/cjs_util.cpp b/fxjs/cjs_util.cpp
index c7bf027695..57267ad418 100644
--- a/fxjs/cjs_util.cpp
+++ b/fxjs/cjs_util.cpp
@@ -58,9 +58,11 @@ const TbConvert TbConvertTable[] = {
} // namespace
const JSMethodSpec CJS_Util::MethodSpecs[] = {
- {"printd", printd_static}, {"printf", printf_static},
- {"printx", printx_static}, {"scand", scand_static},
- {"byteToChar", byteToChar_static}, {0, 0}};
+ {"printd", printd_static},
+ {"printf", printf_static},
+ {"printx", printx_static},
+ {"scand", scand_static},
+ {"byteToChar", byteToChar_static}};
int CJS_Util::ObjDefnID = -1;
@@ -69,7 +71,7 @@ void CJS_Util::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("util", FXJSOBJTYPE_STATIC,
JSConstructor<CJS_Util, util>, JSDestructor<CJS_Util>);
- DefineMethods(pEngine, ObjDefnID, MethodSpecs);
+ DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs));
}
util::util(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
diff --git a/fxjs/cjs_zoomtype.cpp b/fxjs/cjs_zoomtype.cpp
index 1cca58e56d..528bba0a8d 100644
--- a/fxjs/cjs_zoomtype.cpp
+++ b/fxjs/cjs_zoomtype.cpp
@@ -13,8 +13,7 @@ const JSConstSpec CJS_Zoomtype::ConstSpecs[] = {
{"fitH", JSConstSpec::String, 0, "FitHeight"},
{"fitV", JSConstSpec::String, 0, "FitVisibleWidth"},
{"pref", JSConstSpec::String, 0, "Preferred"},
- {"refW", JSConstSpec::String, 0, "ReflowWidth"},
- {0, JSConstSpec::Number, 0, 0}};
+ {"refW", JSConstSpec::String, 0, "ReflowWidth"}};
int CJS_Zoomtype::ObjDefnID = -1;
@@ -22,5 +21,5 @@ int CJS_Zoomtype::ObjDefnID = -1;
void CJS_Zoomtype::DefineJSObjects(CFXJS_Engine* pEngine) {
ObjDefnID =
pEngine->DefineObj("zoomtype", FXJSOBJTYPE_STATIC, nullptr, nullptr);
- DefineConsts(pEngine, ObjDefnID, ConstSpecs);
+ DefineConsts(pEngine, ObjDefnID, ConstSpecs, FX_ArraySize(ConstSpecs));
}
diff --git a/fxjs/xfa/cjx_container.cpp b/fxjs/xfa/cjx_container.cpp
index a5d7921090..cf0aca0cbb 100644
--- a/fxjs/xfa/cjx_container.cpp
+++ b/fxjs/xfa/cjx_container.cpp
@@ -16,11 +16,10 @@
const CJX_MethodSpec CJX_Container::MethodSpecs[] = {
{"getDelta", getDelta_static},
- {"getDeltas", getDeltas_static},
- {"", nullptr}};
+ {"getDeltas", getDeltas_static}};
CJX_Container::CJX_Container(CXFA_Node* node) : CJX_Node(node) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Container::~CJX_Container() {}
diff --git a/fxjs/xfa/cjx_datawindow.cpp b/fxjs/xfa/cjx_datawindow.cpp
index 54f32047fc..47c743f8f7 100644
--- a/fxjs/xfa/cjx_datawindow.cpp
+++ b/fxjs/xfa/cjx_datawindow.cpp
@@ -15,12 +15,11 @@ const CJX_MethodSpec CJX_DataWindow::MethodSpecs[] = {
{"gotoRecord", gotoRecord_static},
{"isRecordGroup", isRecordGroup_static},
{"moveCurrentRecord", moveCurrentRecord_static},
- {"record", record_static},
- {"", nullptr}};
+ {"record", record_static}};
CJX_DataWindow::CJX_DataWindow(CScript_DataWindow* window)
: CJX_Object(window) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_DataWindow::~CJX_DataWindow() {}
diff --git a/fxjs/xfa/cjx_delta.cpp b/fxjs/xfa/cjx_delta.cpp
index 1dfad24319..c361bbb256 100644
--- a/fxjs/xfa/cjx_delta.cpp
+++ b/fxjs/xfa/cjx_delta.cpp
@@ -12,11 +12,10 @@
#include "fxjs/js_resources.h"
#include "xfa/fxfa/parser/cxfa_delta.h"
-const CJX_MethodSpec CJX_Delta::MethodSpecs[] = {{"restore", restore_static},
- {"", nullptr}};
+const CJX_MethodSpec CJX_Delta::MethodSpecs[] = {{"restore", restore_static}};
CJX_Delta::CJX_Delta(CXFA_Delta* delta) : CJX_Object(delta) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Delta::~CJX_Delta() {}
diff --git a/fxjs/xfa/cjx_desc.cpp b/fxjs/xfa/cjx_desc.cpp
index 7ff58a774a..03ab8f8d21 100644
--- a/fxjs/xfa/cjx_desc.cpp
+++ b/fxjs/xfa/cjx_desc.cpp
@@ -12,11 +12,10 @@
#include "fxjs/js_resources.h"
#include "xfa/fxfa/parser/cxfa_desc.h"
-const CJX_MethodSpec CJX_Desc::MethodSpecs[] = {{"metadata", metadata_static},
- {"", nullptr}};
+const CJX_MethodSpec CJX_Desc::MethodSpecs[] = {{"metadata", metadata_static}};
CJX_Desc::CJX_Desc(CXFA_Desc* desc) : CJX_Node(desc) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Desc::~CJX_Desc() {}
diff --git a/fxjs/xfa/cjx_eventpseudomodel.cpp b/fxjs/xfa/cjx_eventpseudomodel.cpp
index a109d1cb70..449153c548 100644
--- a/fxjs/xfa/cjx_eventpseudomodel.cpp
+++ b/fxjs/xfa/cjx_eventpseudomodel.cpp
@@ -45,12 +45,11 @@ void BooleanProperty(CFXJSE_Value* pValue, bool& bValue, bool bSetting) {
const CJX_MethodSpec CJX_EventPseudoModel::MethodSpecs[] = {
{"emit", emit_static},
- {"reset", reset_static},
- {"", nullptr}};
+ {"reset", reset_static}};
CJX_EventPseudoModel::CJX_EventPseudoModel(CScript_EventPseudoModel* model)
: CJX_Object(model) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_EventPseudoModel::~CJX_EventPseudoModel() {}
diff --git a/fxjs/xfa/cjx_exclgroup.cpp b/fxjs/xfa/cjx_exclgroup.cpp
index 6317736ffa..e24be804e0 100644
--- a/fxjs/xfa/cjx_exclgroup.cpp
+++ b/fxjs/xfa/cjx_exclgroup.cpp
@@ -23,11 +23,10 @@ const CJX_MethodSpec CJX_ExclGroup::MethodSpecs[] = {
{"execEvent", execEvent_static},
{"execInitialize", execInitialize_static},
{"execValidate", execValidate_static},
- {"selectedMember", selectedMember_static},
- {"", nullptr}};
+ {"selectedMember", selectedMember_static}};
CJX_ExclGroup::CJX_ExclGroup(CXFA_ExclGroup* group) : CJX_Node(group) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_ExclGroup::~CJX_ExclGroup() {}
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp
index d2cffbc983..4b5f840322 100644
--- a/fxjs/xfa/cjx_field.cpp
+++ b/fxjs/xfa/cjx_field.cpp
@@ -29,11 +29,10 @@ const CJX_MethodSpec CJX_Field::MethodSpecs[] = {
{"getDisplayItem", getDisplayItem_static},
{"getItemState", getItemState_static},
{"getSaveItem", getSaveItem_static},
- {"setItemState", setItemState_static},
- {"", nullptr}};
+ {"setItemState", setItemState_static}};
CJX_Field::CJX_Field(CXFA_Field* field) : CJX_Container(field) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Field::~CJX_Field() {}
diff --git a/fxjs/xfa/cjx_form.cpp b/fxjs/xfa/cjx_form.cpp
index 22a7db2135..54f06fe966 100644
--- a/fxjs/xfa/cjx_form.cpp
+++ b/fxjs/xfa/cjx_form.cpp
@@ -23,11 +23,10 @@ const CJX_MethodSpec CJX_Form::MethodSpecs[] = {
{"execValidate", execValidate_static},
{"formNodes", formNodes_static},
{"recalculate", recalculate_static},
- {"remerge", remerge_static},
- {"", nullptr}};
+ {"remerge", remerge_static}};
CJX_Form::CJX_Form(CXFA_Form* form) : CJX_Model(form) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Form::~CJX_Form() {}
diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp
index 20e3bfe496..555381f623 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -61,12 +61,11 @@ const CJX_MethodSpec CJX_HostPseudoModel::MethodSpecs[] = {
{"print", print_static},
{"resetData", resetData_static},
{"response", response_static},
- {"setFocus", setFocus_static},
- {"", nullptr}};
+ {"setFocus", setFocus_static}};
CJX_HostPseudoModel::CJX_HostPseudoModel(CScript_HostPseudoModel* model)
: CJX_Object(model) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_HostPseudoModel::~CJX_HostPseudoModel() {}
diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp
index 19c6d72cc3..23048f98a5 100644
--- a/fxjs/xfa/cjx_instancemanager.cpp
+++ b/fxjs/xfa/cjx_instancemanager.cpp
@@ -22,12 +22,11 @@ const CJX_MethodSpec CJX_InstanceManager::MethodSpecs[] = {
{"insertInstance", insertInstance_static},
{"moveInstance", moveInstance_static},
{"removeInstance", removeInstance_static},
- {"setInstances", setInstances_static},
- {"", nullptr}};
+ {"setInstances", setInstances_static}};
CJX_InstanceManager::CJX_InstanceManager(CXFA_InstanceManager* mgr)
: CJX_Node(mgr) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_InstanceManager::~CJX_InstanceManager() {}
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp
index b80000a0e2..4165a36e57 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -43,12 +43,11 @@ const CJX_MethodSpec CJX_LayoutPseudoModel::MethodSpecs[] = {
{"sheetInBatch", sheetInBatch_static},
{"w", w_static},
{"x", x_static},
- {"y", y_static},
- {"", nullptr}};
+ {"y", y_static}};
CJX_LayoutPseudoModel::CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model)
: CJX_Object(model) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_LayoutPseudoModel::~CJX_LayoutPseudoModel() {}
diff --git a/fxjs/xfa/cjx_list.cpp b/fxjs/xfa/cjx_list.cpp
index 84bdf7bd07..198804dbed 100644
--- a/fxjs/xfa/cjx_list.cpp
+++ b/fxjs/xfa/cjx_list.cpp
@@ -18,11 +18,10 @@
const CJX_MethodSpec CJX_List::MethodSpecs[] = {{"append", append_static},
{"insert", insert_static},
{"item", item_static},
- {"remove", remove_static},
- {"", nullptr}};
+ {"remove", remove_static}};
CJX_List::CJX_List(CXFA_List* list) : CJX_Object(list) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_List::~CJX_List() {}
diff --git a/fxjs/xfa/cjx_logpseudomodel.cpp b/fxjs/xfa/cjx_logpseudomodel.cpp
index e0ed05d0d1..810ddfa008 100644
--- a/fxjs/xfa/cjx_logpseudomodel.cpp
+++ b/fxjs/xfa/cjx_logpseudomodel.cpp
@@ -16,12 +16,11 @@ const CJX_MethodSpec CJX_LogPseudoModel::MethodSpecs[] = {
{"traceEnabled", traceEnabled_static},
{"traceActivate", traceActivate_static},
{"traceDeactivate", traceDeactivate_static},
- {"trace", trace_static},
- {"", nullptr}};
+ {"trace", trace_static}};
CJX_LogPseudoModel::CJX_LogPseudoModel(CScript_LogPseudoModel* model)
: CJX_Object(model) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_LogPseudoModel::~CJX_LogPseudoModel() {}
diff --git a/fxjs/xfa/cjx_manifest.cpp b/fxjs/xfa/cjx_manifest.cpp
index 6d5da2c60e..0f48b1d28b 100644
--- a/fxjs/xfa/cjx_manifest.cpp
+++ b/fxjs/xfa/cjx_manifest.cpp
@@ -13,11 +13,10 @@
#include "xfa/fxfa/parser/cxfa_manifest.h"
const CJX_MethodSpec CJX_Manifest::MethodSpecs[] = {
- {"evaluate", evaluate_static},
- {"", nullptr}};
+ {"evaluate", evaluate_static}};
CJX_Manifest::CJX_Manifest(CXFA_Manifest* manifest) : CJX_Node(manifest) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Manifest::~CJX_Manifest() {}
diff --git a/fxjs/xfa/cjx_model.cpp b/fxjs/xfa/cjx_model.cpp
index 65084162fb..7ab90e29ba 100644
--- a/fxjs/xfa/cjx_model.cpp
+++ b/fxjs/xfa/cjx_model.cpp
@@ -17,11 +17,10 @@
const CJX_MethodSpec CJX_Model::MethodSpecs[] = {
{"clearErrorList", clearErrorList_static},
{"createNode", createNode_static},
- {"isCompatibleNS", isCompatibleNS_static},
- {"", nullptr}};
+ {"isCompatibleNS", isCompatibleNS_static}};
CJX_Model::CJX_Model(CXFA_Node* node) : CJX_Node(node) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Model::~CJX_Model() {}
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index dd22fb4ca3..d8a3b1c74f 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -135,11 +135,10 @@ const CJX_MethodSpec CJX_Node::MethodSpecs[] = {
{"saveFilteredXML", saveFilteredXML_static},
{"saveXML", saveXML_static},
{"setAttribute", setAttribute_static},
- {"setElement", setElement_static},
- {"", nullptr}};
+ {"setElement", setElement_static}};
CJX_Node::CJX_Node(CXFA_Node* node) : CJX_Tree(node) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Node::~CJX_Node() = default;
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index 81ba1ac3d2..d66483dd74 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -80,8 +80,9 @@ CJX_Object::~CJX_Object() {
ClearMapModuleBuffer();
}
-void CJX_Object::DefineMethods(const CJX_MethodSpec method_specs[]) {
- for (size_t i = 0; method_specs[i].pMethodCall != nullptr; ++i)
+void CJX_Object::DefineMethods(const CJX_MethodSpec method_specs[],
+ size_t count) {
+ for (size_t i = 0; i < count; ++i)
method_specs_[method_specs[i].pName] = method_specs[i].pMethodCall;
}
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index cb8350d2b1..3b9867ed4a 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -116,7 +116,7 @@ class CJX_Object {
void ThrowParamCountMismatchException(const WideString& method) const;
protected:
- void DefineMethods(const CJX_MethodSpec method_specs[]);
+ void DefineMethods(const CJX_MethodSpec method_specs[], size_t count);
void MoveBufferMapData(CXFA_Object* pSrcModule, CXFA_Object* pDstModule);
void SetMapModuleString(void* pKey, const WideStringView& wsValue);
diff --git a/fxjs/xfa/cjx_packet.cpp b/fxjs/xfa/cjx_packet.cpp
index 0040951ac3..2203d9bc9e 100644
--- a/fxjs/xfa/cjx_packet.cpp
+++ b/fxjs/xfa/cjx_packet.cpp
@@ -15,11 +15,10 @@
const CJX_MethodSpec CJX_Packet::MethodSpecs[] = {
{"getAttribute", getAttribute_static},
{"removeAttribute", removeAttribute_static},
- {"setAttribute", setAttribute_static},
- {"", nullptr}};
+ {"setAttribute", setAttribute_static}};
CJX_Packet::CJX_Packet(CXFA_Packet* packet) : CJX_Node(packet) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Packet::~CJX_Packet() {}
diff --git a/fxjs/xfa/cjx_signaturepseudomodel.cpp b/fxjs/xfa/cjx_signaturepseudomodel.cpp
index 6b39ac2488..202532c6ca 100644
--- a/fxjs/xfa/cjx_signaturepseudomodel.cpp
+++ b/fxjs/xfa/cjx_signaturepseudomodel.cpp
@@ -16,13 +16,12 @@ const CJX_MethodSpec CJX_SignaturePseudoModel::MethodSpecs[] = {
{"verify", verifySignature_static},
{"sign", sign_static},
{"enumerate", enumerate_static},
- {"clear", clear_static},
- {"", nullptr}};
+ {"clear", clear_static}};
CJX_SignaturePseudoModel::CJX_SignaturePseudoModel(
CScript_SignaturePseudoModel* model)
: CJX_Object(model) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() {}
diff --git a/fxjs/xfa/cjx_source.cpp b/fxjs/xfa/cjx_source.cpp
index 17512b3e63..85742fee18 100644
--- a/fxjs/xfa/cjx_source.cpp
+++ b/fxjs/xfa/cjx_source.cpp
@@ -29,11 +29,10 @@ const CJX_MethodSpec CJX_Source::MethodSpecs[] = {
{"requery", requery_static},
{"resync", resync_static},
{"update", update_static},
- {"updateBatch", updateBatch_static},
- {"", nullptr}};
+ {"updateBatch", updateBatch_static}};
CJX_Source::CJX_Source(CXFA_Source* src) : CJX_Node(src) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Source::~CJX_Source() {}
diff --git a/fxjs/xfa/cjx_subform.cpp b/fxjs/xfa/cjx_subform.cpp
index a7e1d2a587..fcf4cffd3e 100644
--- a/fxjs/xfa/cjx_subform.cpp
+++ b/fxjs/xfa/cjx_subform.cpp
@@ -20,11 +20,10 @@ const CJX_MethodSpec CJX_Subform::MethodSpecs[] = {
{"execCalculate", execCalculate_static},
{"execEvent", execEvent_static},
{"execInitialize", execInitialize_static},
- {"execValidate", execValidate_static},
- {"", nullptr}};
+ {"execValidate", execValidate_static}};
CJX_Subform::CJX_Subform(CXFA_Node* node) : CJX_Container(node) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Subform::~CJX_Subform() {}
diff --git a/fxjs/xfa/cjx_template.cpp b/fxjs/xfa/cjx_template.cpp
index 48507c3494..8ba2bcab9e 100644
--- a/fxjs/xfa/cjx_template.cpp
+++ b/fxjs/xfa/cjx_template.cpp
@@ -19,11 +19,10 @@ const CJX_MethodSpec CJX_Template::MethodSpecs[] = {
{"execValidate", execValidate_static},
{"formNodes", formNodes_static},
{"recalculate", recalculate_static},
- {"remerge", remerge_static},
- {"", nullptr}};
+ {"remerge", remerge_static}};
CJX_Template::CJX_Template(CXFA_Template* tmpl) : CJX_Model(tmpl) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Template::~CJX_Template() {}
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp
index 6c5e5abd89..8e3143ecc7 100644
--- a/fxjs/xfa/cjx_tree.cpp
+++ b/fxjs/xfa/cjx_tree.cpp
@@ -21,11 +21,10 @@
const CJX_MethodSpec CJX_Tree::MethodSpecs[] = {
{"resolveNode", resolveNode_static},
- {"resolveNodes", resolveNodes_static},
- {"", nullptr}};
+ {"resolveNodes", resolveNodes_static}};
CJX_Tree::CJX_Tree(CXFA_Object* obj) : CJX_Object(obj) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_Tree::~CJX_Tree() {}
diff --git a/fxjs/xfa/cjx_treelist.cpp b/fxjs/xfa/cjx_treelist.cpp
index bb9e4167f8..b91a0b7541 100644
--- a/fxjs/xfa/cjx_treelist.cpp
+++ b/fxjs/xfa/cjx_treelist.cpp
@@ -16,11 +16,10 @@
#include "xfa/fxfa/parser/cxfa_treelist.h"
const CJX_MethodSpec CJX_TreeList::MethodSpecs[] = {
- {"namedItem", namedItem_static},
- {"", nullptr}};
+ {"namedItem", namedItem_static}};
CJX_TreeList::CJX_TreeList(CXFA_TreeList* list) : CJX_List(list) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_TreeList::~CJX_TreeList() {}
diff --git a/fxjs/xfa/cjx_wsdlconnection.cpp b/fxjs/xfa/cjx_wsdlconnection.cpp
index a1d673fae5..1d0c306f14 100644
--- a/fxjs/xfa/cjx_wsdlconnection.cpp
+++ b/fxjs/xfa/cjx_wsdlconnection.cpp
@@ -13,12 +13,11 @@
#include "xfa/fxfa/parser/cxfa_wsdlconnection.h"
const CJX_MethodSpec CJX_WsdlConnection::MethodSpecs[] = {
- {"execute", execute_static},
- {"", nullptr}};
+ {"execute", execute_static}};
CJX_WsdlConnection::CJX_WsdlConnection(CXFA_WsdlConnection* connection)
: CJX_Node(connection) {
- DefineMethods(MethodSpecs);
+ DefineMethods(MethodSpecs, FX_ArraySize(MethodSpecs));
}
CJX_WsdlConnection::~CJX_WsdlConnection() {}