summaryrefslogtreecommitdiff
path: root/xfa/fxjse/value.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-08 13:12:41 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-08 13:12:41 -0700
commit769b137a435fd53a419ebbd1deb8617771b73ef6 (patch)
tree4b4a525a939349e30719b29a7cf1b9f8d78de6aa /xfa/fxjse/value.cpp
parentbc85eecc6cbac54e4b69fe202f802047d2979bf1 (diff)
downloadpdfium-769b137a435fd53a419ebbd1deb8617771b73ef6.tar.xz
Remove more FXJSE c-method wrappers.
This Cl cleans up a bunch of the FXJSE_* methods and moves others into the classes where they most make sense. Review-Url: https://codereview.chromium.org/2045883004
Diffstat (limited to 'xfa/fxjse/value.cpp')
-rw-r--r--xfa/fxjse/value.cpp56
1 files changed, 2 insertions, 54 deletions
diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp
index 64a10f348e..af73a19ead 100644
--- a/xfa/fxjse/value.cpp
+++ b/xfa/fxjse/value.cpp
@@ -11,40 +11,7 @@
#include "xfa/fxjse/class.h"
#include "xfa/fxjse/context.h"
-FX_BOOL FXJSE_Value_IsUndefined(CFXJSE_Value* pValue) {
- return pValue && pValue->IsUndefined();
-}
-
-FX_BOOL FXJSE_Value_IsNull(CFXJSE_Value* pValue) {
- return pValue && pValue->IsNull();
-}
-
-FX_BOOL FXJSE_Value_IsBoolean(CFXJSE_Value* pValue) {
- return pValue && pValue->IsBoolean();
-}
-
-FX_BOOL FXJSE_Value_IsUTF8String(CFXJSE_Value* pValue) {
- return pValue && pValue->IsString();
-}
-
-FX_BOOL FXJSE_Value_IsNumber(CFXJSE_Value* pValue) {
- return pValue && pValue->IsNumber();
-}
-
-FX_BOOL FXJSE_Value_IsObject(CFXJSE_Value* pValue) {
- return pValue && pValue->IsObject();
-}
-
-FX_BOOL FXJSE_Value_IsArray(CFXJSE_Value* pValue) {
- return pValue && pValue->IsArray();
-}
-
-FX_BOOL FXJSE_Value_IsFunction(CFXJSE_Value* pValue) {
- return pValue && pValue->IsFunction();
-}
-
-void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
- const CFX_ByteStringC& utf8Message) {
+void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Message) {
v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
ASSERT(pIsolate);
@@ -52,26 +19,7 @@ void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
v8::Local<v8::String> hMessage = v8::String::NewFromUtf8(
pIsolate, utf8Message.c_str(), v8::String::kNormalString,
utf8Message.GetLength());
- v8::Local<v8::Value> hError;
-
- if (utf8Name == "RangeError") {
- hError = v8::Exception::RangeError(hMessage);
- } else if (utf8Name == "ReferenceError") {
- hError = v8::Exception::ReferenceError(hMessage);
- } else if (utf8Name == "SyntaxError") {
- hError = v8::Exception::SyntaxError(hMessage);
- } else if (utf8Name == "TypeError") {
- hError = v8::Exception::TypeError(hMessage);
- } else {
- hError = v8::Exception::Error(hMessage);
- if (utf8Name != "Error" && !utf8Name.IsEmpty()) {
- hError.As<v8::Object>()->Set(
- v8::String::NewFromUtf8(pIsolate, "name"),
- v8::String::NewFromUtf8(pIsolate, utf8Name.c_str(),
- v8::String::kNormalString,
- utf8Name.GetLength()));
- }
- }
+ v8::Local<v8::Value> hError = v8::Exception::Error(hMessage);
pIsolate->ThrowException(hError);
}