Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 7cf416cfbd240bfd8f85b8ec9dc331b5649df117..7e3fa51261b087bef1e67b46957fb5dcb1c50799 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6156,6 +6156,19 @@ Local<Array> Map::AsArray() const { |
} |
+MaybeLocal<Map> Map::FromArray(Local<Context> context, Local<Array> array) { |
+ PREPARE_FOR_EXECUTION(context, "Map::FromArray", Map); |
+ i::Handle<i::Object> result; |
+ i::Handle<i::Object> argv[] = {Utils::OpenHandle(*array)}; |
+ has_pending_exception = |
+ !i::Execution::Call(isolate, isolate->map_from_array(), |
+ isolate->factory()->undefined_value(), |
+ arraysize(argv), argv, false).ToHandle(&result); |
+ RETURN_ON_FAILED_EXECUTION(Map); |
+ RETURN_ESCAPED(Local<Map>::Cast(Utils::ToLocal(result))); |
+} |
+ |
+ |
Local<v8::Set> v8::Set::New(Isolate* isolate) { |
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
LOG_API(i_isolate, "Set::New"); |
@@ -6192,6 +6205,19 @@ Local<Array> Set::AsArray() const { |
} |
+MaybeLocal<Set> Set::FromArray(Local<Context> context, Local<Array> array) { |
+ PREPARE_FOR_EXECUTION(context, "Set::FromArray", Set); |
+ i::Handle<i::Object> result; |
+ i::Handle<i::Object> argv[] = {Utils::OpenHandle(*array)}; |
+ has_pending_exception = |
+ !i::Execution::Call(isolate, isolate->set_from_array(), |
+ isolate->factory()->undefined_value(), |
+ arraysize(argv), argv, false).ToHandle(&result); |
+ RETURN_ON_FAILED_EXECUTION(Set); |
+ RETURN_ESCAPED(Local<Set>::Cast(Utils::ToLocal(result))); |
+} |
+ |
+ |
bool Value::IsPromise() const { |
auto self = Utils::OpenHandle(this); |
return i::Object::IsPromise(self); |