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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/collection.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 public: 2969 public:
2970 size_t Size() const; 2970 size_t Size() const;
2971 2971
2972 /** 2972 /**
2973 * Returns an array of [key, value] arrays representing the contents 2973 * Returns an array of [key, value] arrays representing the contents
2974 * of this Map. 2974 * of this Map.
2975 */ 2975 */
2976 Local<Array> AsArray() const; 2976 Local<Array> AsArray() const;
2977 2977
2978 /** 2978 /**
2979 * Creates a new Map. 2979 * Creates a new empty Map.
2980 */ 2980 */
2981 static Local<Map> New(Isolate* isolate); 2981 static Local<Map> New(Isolate* isolate);
2982 2982
2983 /**
2984 * Creates a new Map containing the elements of array, which must be comprised
2985 * of [key, value] arrays.
2986 * 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
2987 */
2988 static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context,
2989 Local<Array> array);
2990
2983 V8_INLINE static Map* Cast(Value* obj); 2991 V8_INLINE static Map* Cast(Value* obj);
2984 2992
2985 private: 2993 private:
2986 Map(); 2994 Map();
2987 static void CheckCast(Value* obj); 2995 static void CheckCast(Value* obj);
2988 }; 2996 };
2989 2997
2990 2998
2991 /** 2999 /**
2992 * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1). 3000 * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1).
2993 */ 3001 */
2994 class V8_EXPORT Set : public Object { 3002 class V8_EXPORT Set : public Object {
2995 public: 3003 public:
2996 size_t Size() const; 3004 size_t Size() const;
2997 3005
2998 /** 3006 /**
2999 * Returns an array of the keys in this Set. 3007 * Returns an array of the keys in this Set.
3000 */ 3008 */
3001 Local<Array> AsArray() const; 3009 Local<Array> AsArray() const;
3002 3010
3003 /** 3011 /**
3004 * Creates a new Set. 3012 * Creates a new empty Set.
3005 */ 3013 */
3006 static Local<Set> New(Isolate* isolate); 3014 static Local<Set> New(Isolate* isolate);
3007 3015
3016 /**
3017 * Creates a new Set containing the items in array.
3018 * Guaranteed to be side-effect free if the array contains no holes.
3019 */
3020 static V8_WARN_UNUSED_RESULT MaybeLocal<Set> FromArray(Local<Context> context,
3021 Local<Array> array);
3022
3008 V8_INLINE static Set* Cast(Value* obj); 3023 V8_INLINE static Set* Cast(Value* obj);
3009 3024
3010 private: 3025 private:
3011 Set(); 3026 Set();
3012 static void CheckCast(Value* obj); 3027 static void CheckCast(Value* obj);
3013 }; 3028 };
3014 3029
3015 3030
3016 template<typename T> 3031 template<typename T>
3017 class ReturnValue { 3032 class ReturnValue {
(...skipping 5158 matching lines...) Expand 10 before | Expand all | Expand 10 after
8176 */ 8191 */
8177 8192
8178 8193
8179 } // namespace v8 8194 } // namespace v8
8180 8195
8181 8196
8182 #undef TYPE_CHECK 8197 #undef TYPE_CHECK
8183 8198
8184 8199
8185 #endif // V8_H_ 8200 #endif // V8_H_
OLDNEW
« 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