summaryrefslogtreecommitdiff
path: root/js/src/jsbool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsbool.cpp')
-rw-r--r--js/src/jsbool.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp
index 324868216b..0a70fe49f2 100644
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -18,6 +18,7 @@
#include "vm/GlobalObject.h"
#include "vm/ProxyObject.h"
#include "vm/StringBuffer.h"
+#include "vm/BigIntType.h"
#include "vm/BooleanObject-inl.h"
@@ -170,6 +171,8 @@ js::ToBooleanSlow(HandleValue v)
{
if (v.isString())
return v.toString()->length() != 0;
+ if (v.isBigInt())
+ return !v.toBigInt()->isZero();
MOZ_ASSERT(v.isObject());
return !EmulatesUndefined(&v.toObject());