OLD | NEW |
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 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2970 | 2970 |
2971 | 2971 |
2972 /** | 2972 /** |
2973 * An instance of the built-in Map constructor (ECMA-262, 6th Edition, 23.1.1). | 2973 * An instance of the built-in Map constructor (ECMA-262, 6th Edition, 23.1.1). |
2974 */ | 2974 */ |
2975 class V8_EXPORT Map : public Object { | 2975 class V8_EXPORT Map : public Object { |
2976 public: | 2976 public: |
2977 size_t Size() const; | 2977 size_t Size() const; |
2978 | 2978 |
2979 /** | 2979 /** |
2980 * Returns an array of [key, value] arrays representing the contents | 2980 * Returns an array of length Size() * 2, where index N is the Nth key and |
2981 * of this Map. | 2981 * index N + 1 is the Nth value. |
2982 */ | 2982 */ |
2983 Local<Array> AsArray() const; | 2983 Local<Array> AsArray() const; |
2984 | 2984 |
2985 /** | 2985 /** |
2986 * Creates a new empty Map. | 2986 * Creates a new empty Map. |
2987 */ | 2987 */ |
2988 static Local<Map> New(Isolate* isolate); | 2988 static Local<Map> New(Isolate* isolate); |
2989 | 2989 |
2990 /** | 2990 /** |
2991 * Creates a new Map containing the elements of array, which must be comprised | 2991 * Creates a new Map containing the elements of array, which must be formatted |
2992 * of [key, value] arrays. | 2992 * in the same manner as the array returned from AsArray(). |
2993 * Guaranteed to be side-effect free if the array contains no holes. | 2993 * Guaranteed to be side-effect free if the array contains no holes. |
2994 */ | 2994 */ |
2995 static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context, | 2995 static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context, |
2996 Local<Array> array); | 2996 Local<Array> array); |
2997 | 2997 |
2998 V8_INLINE static Map* Cast(Value* obj); | 2998 V8_INLINE static Map* Cast(Value* obj); |
2999 | 2999 |
3000 private: | 3000 private: |
3001 Map(); | 3001 Map(); |
3002 static void CheckCast(Value* obj); | 3002 static void CheckCast(Value* obj); |
(...skipping 5306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8309 */ | 8309 */ |
8310 | 8310 |
8311 | 8311 |
8312 } // namespace v8 | 8312 } // namespace v8 |
8313 | 8313 |
8314 | 8314 |
8315 #undef TYPE_CHECK | 8315 #undef TYPE_CHECK |
8316 | 8316 |
8317 | 8317 |
8318 #endif // V8_H_ | 8318 #endif // V8_H_ |
OLD | NEW |