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

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: 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') | src/collection.js » ('J')
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 00bc3364bb8edbaef662039533c5432c52e6ba56..a7390555d565fe683d5d9001a90cb25b0c05c7f9 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2976,10 +2976,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.
arv (Not doing code reviews) 2015/05/26 16:37:40 If the main use case is structured clone we could
adamk 2015/05/26 17:27:44 Let's leave this for a later round where we optimi
+ */
+ static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context,
+ Local<Array> array);
+
V8_INLINE static Map* Cast(Value* obj);
private:
@@ -3001,10 +3009,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') | src/collection.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698