Skip to content
Permalink
Browse files

add function convert uint64 to BigInt.

  • Loading branch information...
xicilion committed Jun 29, 2018
1 parent 54f49bb commit d069cf7731c5d32cd614d182c6e486a7afccfe0a
Showing with 7 additions and 0 deletions.
  1. +1 −0 fibjs/include/v8_api.h
  2. +6 −0 fibjs/src/base/v8_api.cpp
@@ -10,6 +10,7 @@

namespace fibjs {

v8::Local<v8::BigInt> BigInt_New(v8::Isolate* isolate, uint64_t value);
void InvokeApiInterruptCallbacks(v8::Isolate* isolate);

struct V8FrameInfo {
@@ -26,6 +26,12 @@ namespace fibjs {

bool path_isAbsolute(exlib::string path);

v8::Local<v8::BigInt> BigInt_New(v8::Isolate* isolate, uint64_t value) {
v8::internal::Isolate* internal_isolate = reinterpret_cast<v8::internal::Isolate*>(isolate);
v8::internal::Handle<v8::internal::BigInt> result = v8::internal::BigInt::FromUint64(internal_isolate, value);
return v8::Utils::ToLocal(result);
}

void InvokeApiInterruptCallbacks(v8::Isolate* isolate)
{
v8::internal::Isolate* v8_isolate = (v8::internal::Isolate*)isolate;

0 comments on commit d069cf7

Please sign in to comment.
You can’t perform that action at this time.