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

Side by Side Diff: include/v8.h

Issue 1157453002: Add basic API support for Map & Set (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.h » ('j') | src/bootstrapper.cc » ('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 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 bool IsGeneratorObject() const; 1801 bool IsGeneratorObject() const;
1802 1802
1803 /** 1803 /**
1804 * Returns true if this value is a Promise. 1804 * Returns true if this value is a Promise.
1805 * This is an experimental feature. 1805 * This is an experimental feature.
1806 */ 1806 */
1807 bool IsPromise() const; 1807 bool IsPromise() const;
1808 1808
1809 /** 1809 /**
1810 * Returns true if this value is a Map. 1810 * Returns true if this value is a Map.
1811 * This is an experimental feature.
1812 */ 1811 */
1813 bool IsMap() const; 1812 bool IsMap() const;
1814 1813
1815 /** 1814 /**
1816 * Returns true if this value is a Set. 1815 * Returns true if this value is a Set.
1817 * This is an experimental feature.
1818 */ 1816 */
1819 bool IsSet() const; 1817 bool IsSet() const;
1820 1818
1821 /** 1819 /**
1822 * Returns true if this value is a Map Iterator. 1820 * Returns true if this value is a Map Iterator.
1823 * This is an experimental feature.
1824 */ 1821 */
1825 bool IsMapIterator() const; 1822 bool IsMapIterator() const;
1826 1823
1827 /** 1824 /**
1828 * Returns true if this value is a Set Iterator. 1825 * Returns true if this value is a Set Iterator.
1829 * This is an experimental feature.
1830 */ 1826 */
1831 bool IsSetIterator() const; 1827 bool IsSetIterator() const;
1832 1828
1833 /** 1829 /**
1834 * Returns true if this value is a WeakMap. 1830 * Returns true if this value is a WeakMap.
1835 * This is an experimental feature.
1836 */ 1831 */
1837 bool IsWeakMap() const; 1832 bool IsWeakMap() const;
1838 1833
1839 /** 1834 /**
1840 * Returns true if this value is a WeakSet. 1835 * Returns true if this value is a WeakSet.
1841 * This is an experimental feature.
1842 */ 1836 */
1843 bool IsWeakSet() const; 1837 bool IsWeakSet() const;
1844 1838
1845 /** 1839 /**
1846 * Returns true if this value is an ArrayBuffer. 1840 * Returns true if this value is an ArrayBuffer.
1847 * This is an experimental feature. 1841 * This is an experimental feature.
1848 */ 1842 */
1849 bool IsArrayBuffer() const; 1843 bool IsArrayBuffer() const;
1850 1844
1851 /** 1845 /**
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2961 */ 2955 */
2962 static Local<Array> New(Isolate* isolate, int length = 0); 2956 static Local<Array> New(Isolate* isolate, int length = 0);
2963 2957
2964 V8_INLINE static Array* Cast(Value* obj); 2958 V8_INLINE static Array* Cast(Value* obj);
2965 private: 2959 private:
2966 Array(); 2960 Array();
2967 static void CheckCast(Value* obj); 2961 static void CheckCast(Value* obj);
2968 }; 2962 };
2969 2963
2970 2964
2965 /**
2966 * An instance of the built-in Map constructor (ECMA-262, 6th Edition, 23.1.1).
2967 */
2968 class V8_EXPORT Map : public Object {
2969 public:
2970 size_t Size() const;
2971
2972 /**
2973 * Creates a new Map.
2974 */
2975 static Local<Map> New(Isolate* isolate);
2976
2977 V8_INLINE static Map* Cast(Value* obj);
2978
2979 private:
2980 Map();
2981 static void CheckCast(Value* obj);
2982 };
2983
2984
2985 /**
2986 * An instance of the built-in Set constructor (ECMA-262, 6th Edition, 23.2.1).
2987 */
2988 class V8_EXPORT Set : public Object {
2989 public:
2990 size_t Size() const;
2991
2992 /**
2993 * Creates a new Set.
2994 */
2995 static Local<Set> New(Isolate* isolate);
2996
2997 V8_INLINE static Set* Cast(Value* obj);
2998
2999 private:
3000 Set();
3001 static void CheckCast(Value* obj);
3002 };
3003
3004
2971 template<typename T> 3005 template<typename T>
2972 class ReturnValue { 3006 class ReturnValue {
2973 public: 3007 public:
2974 template <class S> V8_INLINE ReturnValue(const ReturnValue<S>& that) 3008 template <class S> V8_INLINE ReturnValue(const ReturnValue<S>& that)
2975 : value_(that.value_) { 3009 : value_(that.value_) {
2976 TYPE_CHECK(T, S); 3010 TYPE_CHECK(T, S);
2977 } 3011 }
2978 // Handle setters 3012 // Handle setters
2979 template <typename S> 3013 template <typename S>
2980 V8_INLINE V8_DEPRECATE_SOON("Use Global<> instead", 3014 V8_INLINE V8_DEPRECATE_SOON("Use Global<> instead",
(...skipping 4709 matching lines...) Expand 10 before | Expand all | Expand 10 after
7690 7724
7691 7725
7692 Array* Array::Cast(v8::Value* value) { 7726 Array* Array::Cast(v8::Value* value) {
7693 #ifdef V8_ENABLE_CHECKS 7727 #ifdef V8_ENABLE_CHECKS
7694 CheckCast(value); 7728 CheckCast(value);
7695 #endif 7729 #endif
7696 return static_cast<Array*>(value); 7730 return static_cast<Array*>(value);
7697 } 7731 }
7698 7732
7699 7733
7734 Map* Map::Cast(v8::Value* value) {
7735 #ifdef V8_ENABLE_CHECKS
7736 CheckCast(value);
7737 #endif
7738 return static_cast<Map*>(value);
7739 }
7740
7741
7742 Set* Set::Cast(v8::Value* value) {
7743 #ifdef V8_ENABLE_CHECKS
7744 CheckCast(value);
7745 #endif
7746 return static_cast<Set*>(value);
7747 }
7748
7749
7700 Promise* Promise::Cast(v8::Value* value) { 7750 Promise* Promise::Cast(v8::Value* value) {
7701 #ifdef V8_ENABLE_CHECKS 7751 #ifdef V8_ENABLE_CHECKS
7702 CheckCast(value); 7752 CheckCast(value);
7703 #endif 7753 #endif
7704 return static_cast<Promise*>(value); 7754 return static_cast<Promise*>(value);
7705 } 7755 }
7706 7756
7707 7757
7708 Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) { 7758 Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) {
7709 #ifdef V8_ENABLE_CHECKS 7759 #ifdef V8_ENABLE_CHECKS
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
8115 */ 8165 */
8116 8166
8117 8167
8118 } // namespace v8 8168 } // namespace v8
8119 8169
8120 8170
8121 #undef TYPE_CHECK 8171 #undef TYPE_CHECK
8122 8172
8123 8173
8124 #endif // V8_H_ 8174 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.h » ('j') | src/bootstrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698