summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-09-25 17:11:11 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2012-09-25 17:11:11 +0100
commit3e7f093001706a622afc63861841e2fa642f8a0a (patch)
tree3c1ce4074e28ab88e57b10d0ff1bdf77c3f2badd
parentae14bea1c5a26e85bdabacbc105fca037808429e (diff)
downloadmupdf-3e7f093001706a622afc63861841e2fa642f8a0a.tar.xz
Javascript: support test for boolean
-rw-r--r--pdf/mupdf-internal.h3
-rw-r--r--pdf/pdf_jsimp_v8.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/pdf/mupdf-internal.h b/pdf/mupdf-internal.h
index 7ac97f2a..c0fffcf5 100644
--- a/pdf/mupdf-internal.h
+++ b/pdf/mupdf-internal.h
@@ -674,7 +674,8 @@ enum
JS_TYPE_NULL,
JS_TYPE_STRING,
JS_TYPE_NUMBER,
- JS_TYPE_ARRAY
+ JS_TYPE_ARRAY,
+ JS_TYPE_BOOLEAN
};
pdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx);
diff --git a/pdf/pdf_jsimp_v8.cpp b/pdf/pdf_jsimp_v8.cpp
index 47fab860..d16a4663 100644
--- a/pdf/pdf_jsimp_v8.cpp
+++ b/pdf/pdf_jsimp_v8.cpp
@@ -164,6 +164,8 @@ public:
return JS_TYPE_NUMBER;
else if (pobj->IsArray())
return JS_TYPE_ARRAY;
+ else if (pobj->IsBoolean() || pobj->IsBooleanObject())
+ return JS_TYPE_BOOLEAN;
else
return JS_TYPE_UNKNOWN;
}