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

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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
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 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 public: 2951 public:
2952 size_t Size() const; 2952 size_t Size() const;
2953 2953
2954 /** 2954 /**
2955 * Returns an array of [key, value] arrays representing the contents 2955 * Returns an array of [key, value] arrays representing the contents
2956 * of this Map. 2956 * of this Map.
2957 */ 2957 */
2958 Local<Array> AsArray() const; 2958 Local<Array> AsArray() const;
2959 2959
2960 /** 2960 /**
2961 * Creates a new Map. 2961 * Creates a new empty Map.
2962 */ 2962 */
2963 static Local<Map> New(Isolate* isolate); 2963 static Local<Map> New(Isolate* isolate);
2964 2964
2965 /**
2966 * Creates a new Map containing the elements of array, which must be comprised
2967 * of [key, value] arrays.
2968 * Guaranteed to be side-effect free if the array contains no holes.
2969 */
2970 static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context,
2971 Local<Array> array);
2972
2965 V8_INLINE static Map* Cast(Value* obj); 2973 V8_INLINE static Map* Cast(Value* obj);
2966 2974
2967 private: 2975 private:
2968 Map(); 2976 Map();
2969 static void CheckCast(Value* obj); 2977 static void CheckCast(Value* obj);
2970 }; 2978 };
2971 2979
2972 2980
2973 /** 2981 /**
2974 * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1). 2982 * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1).
2975 */ 2983 */
2976 class V8_EXPORT Set : public Object { 2984 class V8_EXPORT Set : public Object {
2977 public: 2985 public:
2978 size_t Size() const; 2986 size_t Size() const;
2979 2987
2980 /** 2988 /**
2981 * Returns an array of the keys in this Set. 2989 * Returns an array of the keys in this Set.
2982 */ 2990 */
2983 Local<Array> AsArray() const; 2991 Local<Array> AsArray() const;
2984 2992
2985 /** 2993 /**
2986 * Creates a new Set. 2994 * Creates a new empty Set.
2987 */ 2995 */
2988 static Local<Set> New(Isolate* isolate); 2996 static Local<Set> New(Isolate* isolate);
2989 2997
2998 /**
2999 * Creates a new Set containing the items in array.
3000 * Guaranteed to be side-effect free if the array contains no holes.
3001 */
3002 static V8_WARN_UNUSED_RESULT MaybeLocal<Set> FromArray(Local<Context> context,
3003 Local<Array> array);
3004
2990 V8_INLINE static Set* Cast(Value* obj); 3005 V8_INLINE static Set* Cast(Value* obj);
2991 3006
2992 private: 3007 private:
2993 Set(); 3008 Set();
2994 static void CheckCast(Value* obj); 3009 static void CheckCast(Value* obj);
2995 }; 3010 };
2996 3011
2997 3012
2998 template<typename T> 3013 template<typename T>
2999 class ReturnValue { 3014 class ReturnValue {
(...skipping 5269 matching lines...) Expand 10 before | Expand all | Expand 10 after
8269 */ 8284 */
8270 8285
8271 8286
8272 } // namespace v8 8287 } // namespace v8
8273 8288
8274 8289
8275 #undef TYPE_CHECK 8290 #undef TYPE_CHECK
8276 8291
8277 8292
8278 #endif // V8_H_ 8293 #endif // V8_H_
OLDNEW
« 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