summaryrefslogtreecommitdiff
path: root/testing/resources/javascript/document_props.in
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-02 12:18:50 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-02 12:18:50 -0800
commitb720d0a14601f1496ef15297bc46d401f5a2a890 (patch)
treed19c5604c1528646d992ffcd1beabe8279d5d4b3 /testing/resources/javascript/document_props.in
parent944ccad72d028ed5e37f53c5c8c0888866905bc3 (diff)
downloadpdfium-b720d0a14601f1496ef15297bc46d401f5a2a890.tar.xz
Return error information from pdfium to JS.
This implements the previously unimplemented JS_Error() function. Along the way: - fix some IWYU when the include order in global.cpp was perturbed. - remove some uses of JS_ErrorString, to increase transparency. - use vp.IsSetting() in place of !vp.IsGetting() for clarity. - specify an error string on several error return paths. - add an error string for writing readonly properties. - rename an error string constant to reflect the actual message. - replace calls to variadic Format() with a function doing string appends. - remove unused JS_GetClassName() R=thestig@chromium.org Review URL: https://codereview.chromium.org/963193003
Diffstat (limited to 'testing/resources/javascript/document_props.in')
-rw-r--r--testing/resources/javascript/document_props.in30
1 files changed, 15 insertions, 15 deletions
diff --git a/testing/resources/javascript/document_props.in b/testing/resources/javascript/document_props.in
index 8ab7e3d566..c628fafad2 100644
--- a/testing/resources/javascript/document_props.in
+++ b/testing/resources/javascript/document_props.in
@@ -105,27 +105,27 @@ var document_props = [
];
function testGetProps(props) {
- try {
- app.alert('*** Getting properties ***');
- for (var i = 0; i < props.length; ++i) {
- var expr1 = "this." + props[i];
- var expr2 = "typeof " + expr1;
- app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
+ app.alert('*** Getting properties ***');
+ for (var i = 0; i < props.length; ++i) {
+ try {
+ var expr1 = "this." + props[i];
+ var expr2 = "typeof " + expr1;
+ app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
+ } catch (e) {
+ app.alert("ERROR: " + e.toString());
}
- } catch (e) {
- app.alert("ERROR: " + e.toString());
}
}
function testSetProps(props) {
- try {
- app.alert('*** Setting properties ***');
- for (var i = 0; i < props.length; ++i) {
- var expr1 = "this." + props[i] + ' = 3;'
- app.alert(expr1 + " yields " + eval(expr1));
+ app.alert('*** Setting properties ***');
+ for (var i = 0; i < props.length; ++i) {
+ try {
+ var expr1 = "this." + props[i] + ' = 3;'
+ app.alert(expr1 + " yields " + eval(expr1));
+ } catch (e) {
+ app.alert("ERROR: " + e.toString());
}
- } catch (e) {
- app.alert("ERROR: " + e.toString());
}
}