Return error information from pdfium to JS.
authorTom Sepez <tsepez@chromium.org>
Mon, 2 Mar 2015 20:18:50 +0000 (12:18 -0800)
committerTom Sepez <tsepez@chromium.org>
Mon, 2 Mar 2015 20:18:50 +0000 (12:18 -0800)
commitb720d0a14601f1496ef15297bc46d401f5a2a890
treed19c5604c1528646d992ffcd1beabe8279d5d4b3
parent944ccad72d028ed5e37f53c5c8c0888866905bc3
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
14 files changed:
fpdfsdk/include/javascript/IJavaScript.h
fpdfsdk/include/javascript/JS_Define.h
fpdfsdk/include/javascript/JS_Object.h
fpdfsdk/include/javascript/resource.h
fpdfsdk/include/jsapi/fxjs_v8.h
fpdfsdk/src/javascript/Document.cpp
fpdfsdk/src/javascript/console.cpp
fpdfsdk/src/javascript/global.cpp
fpdfsdk/src/javascript/resource.cpp
fpdfsdk/src/jsapi/fxjs_v8.cpp
testing/resources/javascript/document_props.in
testing/resources/javascript/document_props_expected.txt
testing/resources/javascript/globals.in
testing/resources/javascript/globals_expected.txt