summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/resource.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-02 12:59:05 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-02 12:59:05 -0800
commit3a83266acee37e99832adaf1337c6b3ab7559f50 (patch)
tree8700b04028864100e2618a72e4a9f52a6bc2f224 /fpdfsdk/src/javascript/resource.cpp
parentfb3eea5323bf59884659510a6743037cc1d546cd (diff)
downloadpdfium-3a83266acee37e99832adaf1337c6b3ab7559f50.tar.xz
Merge to XFA: Return error information from pdfium to JS.
Cherry-pick from b720d0a14601f1496ef15297bc46d401f5a2a890 + Manually resolve merge conflicts + Fix more IWYU to fix compile. Original Review URL: https://codereview.chromium.org/963193003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/971013002
Diffstat (limited to 'fpdfsdk/src/javascript/resource.cpp')
-rw-r--r--fpdfsdk/src/javascript/resource.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/resource.cpp b/fpdfsdk/src/javascript/resource.cpp
index 1c453dcda7..be24ccd66c 100644
--- a/fpdfsdk/src/javascript/resource.cpp
+++ b/fpdfsdk/src/javascript/resource.cpp
@@ -39,9 +39,24 @@ CFX_WideString JSGetStringFromID(CJS_Context* pContext, FX_UINT id)
return L"The second parameter can't be converted to a Date.";
case IDS_STRING_JSPRINT2:
return L"The second parameter is an invalid Date!";
- case IDS_JSPARAM_INCORRECT:
+ case IDS_STRING_JSNOGLOBAL:
return L"Global value not found.";
+ case IDS_STRING_JSREADONLY:
+ return L"Cannot assign to readonly property.";
default:
return L"";
}
}
+
+CFX_WideString JSFormatErrorString(const char* class_name,
+ const char* property_name,
+ const CFX_WideString& details) {
+ CFX_WideString result = CFX_WideString::FromLocal(class_name);
+ if (property_name) {
+ result += L".";
+ result += CFX_WideString::FromLocal(property_name);
+ }
+ result += L": ";
+ result += details;
+ return result;
+}