Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(918)

Unified Diff: include/v8.h

Issue 1155893003: Add {Map,Set}::FromArray to the API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index fb07e9ce8c68cdf94d29665cafa614b265b31b8f..0bc9d6453d476710776ba1d3ac954d479491a50b 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2958,10 +2958,18 @@ class V8_EXPORT Map : public Object {
Local<Array> AsArray() const;
/**
- * Creates a new Map.
+ * Creates a new empty Map.
*/
static Local<Map> New(Isolate* isolate);
+ /**
+ * Creates a new Map containing the elements of array, which must be comprised
+ * of [key, value] arrays.
+ * Guaranteed to be side-effect free if the array contains no holes.
+ */
+ static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context,
+ Local<Array> array);
+
V8_INLINE static Map* Cast(Value* obj);
private:
@@ -2983,10 +2991,17 @@ class V8_EXPORT Set : public Object {
Local<Array> AsArray() const;
/**
- * Creates a new Set.
+ * Creates a new empty Set.
*/
static Local<Set> New(Isolate* isolate);
+ /**
+ * Creates a new Set containing the items in array.
+ * Guaranteed to be side-effect free if the array contains no holes.
+ */
+ static V8_WARN_UNUSED_RESULT MaybeLocal<Set> FromArray(Local<Context> context,
+ Local<Array> array);
+
V8_INLINE static Set* Cast(Value* obj);
private:
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698