summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Value.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-29 08:55:30 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-29 08:55:30 -0800
commit66519af52b61ca158044651d0507d47efb364f87 (patch)
treec0def01f0a7603ff7ae0dadd4bed6d3316f508f6 /fpdfsdk/src/javascript/JS_Value.h
parentd45e7a51904164fb22049f0a7a80d2a94c06936b (diff)
downloadpdfium-66519af52b61ca158044651d0507d47efb364f87.tar.xz
Fix behaviour of app.alert() with a single object argument.
Centralize the "arguments in an object" logic. See the section "Method Arguments" in the js_api_reference.pdf. Add some tests to hit the ambiguous cases this section implies, and test that all parameters are passed end-to-end to our callbacks. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1641693003 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Value.h')
-rw-r--r--fpdfsdk/src/javascript/JS_Value.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fpdfsdk/src/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h
index 20a6e38b46..c33a973a12 100644
--- a/fpdfsdk/src/javascript/JS_Value.h
+++ b/fpdfsdk/src/javascript/JS_Value.h
@@ -213,4 +213,16 @@ double JS_MakeDate(double day, double time);
bool JS_PortIsNan(double d);
double JS_LocalTime(double d);
+// Some JS methods have the bizarre convention that they may also be called
+// with a single argument which is an object containing the actual arguments
+// as its properties. The varying arguments to this method are the property
+// names as wchar_t string literals corresponding to each positional argument.
+// The result will always contain |nKeywords| value, with unspecified ones
+// being set to type VT_unknown.
+std::vector<CJS_Value> JS_ExpandKeywordParams(
+ CJS_Runtime* pRuntime,
+ const std::vector<CJS_Value>& originals,
+ size_t nKeywords,
+ ...);
+
#endif // FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_