summaryrefslogtreecommitdiff
path: root/js/src/jsatom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsatom.cpp')
-rw-r--r--js/src/jsatom.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp
index 02308314c9..2a72ac38a3 100644
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -28,6 +28,8 @@
#include "vm/String-inl.h"
+#include "vm/BigIntType.h"
+
using namespace js;
using namespace js::gc;
@@ -484,6 +486,13 @@ ToAtomSlow(ExclusiveContext* cx, typename MaybeRooted<Value, allowGC>::HandleTyp
}
return nullptr;
}
+ if (v.isBigInt()) {
+ RootedBigInt i(cx, v.toBigInt());
+ JSAtom* atom = BigIntToAtom(cx, i);
+ if (!allowGC && !atom)
+ cx->recoverFromOutOfMemory();
+ return atom;
+ }
MOZ_ASSERT(v.isUndefined());
return cx->names().undefined;
}