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

Side by Side Diff: include/v8.h

Issue 7344013: Expose APIs for detecting boxed primitives, native errors and Math. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Get rid of unclear 'box' comments/strings. Created 9 years, 5 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 #endif // _WIN32 74 #endif // _WIN32
75 75
76 /** 76 /**
77 * The v8 JavaScript engine. 77 * The v8 JavaScript engine.
78 */ 78 */
79 namespace v8 { 79 namespace v8 {
80 80
81 class Context; 81 class Context;
82 class String; 82 class String;
83 class StringObject;
83 class Value; 84 class Value;
84 class Utils; 85 class Utils;
85 class Number; 86 class Number;
87 class NumberObject;
86 class Object; 88 class Object;
87 class Array; 89 class Array;
88 class Int32; 90 class Int32;
89 class Uint32; 91 class Uint32;
90 class External; 92 class External;
91 class Primitive; 93 class Primitive;
92 class Boolean; 94 class Boolean;
95 class BooleanObject;
93 class Integer; 96 class Integer;
94 class Function; 97 class Function;
95 class Date; 98 class Date;
96 class ImplementationUtilities; 99 class ImplementationUtilities;
97 class Signature; 100 class Signature;
98 template <class T> class Handle; 101 template <class T> class Handle;
99 template <class T> class Local; 102 template <class T> class Local;
100 template <class T> class Persistent; 103 template <class T> class Persistent;
101 class FunctionTemplate; 104 class FunctionTemplate;
102 class ObjectTemplate; 105 class ObjectTemplate;
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 * Returns true if this value is a 32-bit unsigned integer. 925 * Returns true if this value is a 32-bit unsigned integer.
923 */ 926 */
924 V8EXPORT bool IsUint32() const; 927 V8EXPORT bool IsUint32() const;
925 928
926 /** 929 /**
927 * Returns true if this value is a Date. 930 * Returns true if this value is a Date.
928 */ 931 */
929 V8EXPORT bool IsDate() const; 932 V8EXPORT bool IsDate() const;
930 933
931 /** 934 /**
935 * Returns true if this value is an instance of the Boolean constructor.
Vyacheslav Egorov (Chromium) 2011/07/13 09:10:17 I suggest clearer wording: "Returns true if this
936 */
937 V8EXPORT bool IsBooleanObject() const;
938
939 /**
940 * Returns true if this value is an instance of the Number constructor.
941 */
942 V8EXPORT bool IsNumberObject() const;
943
944 /**
945 * Returns true if this value is an instance of the String constructor.
946 */
947 V8EXPORT bool IsStringObject() const;
948
949 /**
950 * Returns true if this value is a NativeError.
951 */
952 V8EXPORT bool IsNativeError() const;
953
954 /**
932 * Returns true if this value is a RegExp. 955 * Returns true if this value is a RegExp.
933 */ 956 */
934 V8EXPORT bool IsRegExp() const; 957 V8EXPORT bool IsRegExp() const;
935 958
936 V8EXPORT Local<Boolean> ToBoolean() const; 959 V8EXPORT Local<Boolean> ToBoolean() const;
937 V8EXPORT Local<Number> ToNumber() const; 960 V8EXPORT Local<Number> ToNumber() const;
938 V8EXPORT Local<String> ToString() const; 961 V8EXPORT Local<String> ToString() const;
939 V8EXPORT Local<String> ToDetailString() const; 962 V8EXPORT Local<String> ToDetailString() const;
940 V8EXPORT Local<Object> ToObject() const; 963 V8EXPORT Local<Object> ToObject() const;
941 V8EXPORT Local<Integer> ToInteger() const; 964 V8EXPORT Local<Integer> ToInteger() const;
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 * negatively impact the performance of date operations. 1761 * negatively impact the performance of date operations.
1739 */ 1762 */
1740 V8EXPORT static void DateTimeConfigurationChangeNotification(); 1763 V8EXPORT static void DateTimeConfigurationChangeNotification();
1741 1764
1742 private: 1765 private:
1743 V8EXPORT static void CheckCast(v8::Value* obj); 1766 V8EXPORT static void CheckCast(v8::Value* obj);
1744 }; 1767 };
1745 1768
1746 1769
1747 /** 1770 /**
1771 * An instance of the built-in Number constructor (ECMA-262, 15.7).
1772 */
1773 class NumberObject : public Object {
1774 public:
1775 V8EXPORT static Local<Value> New(double value);
1776
1777 /**
1778 * A specialization of Value::NumberValue that is more efficient
1779 * because we know the structure of this object.
1780 */
1781 V8EXPORT double NumberValue() const;
1782
1783 static inline NumberObject* Cast(v8::Value* obj);
1784
1785 private:
1786 V8EXPORT static void CheckCast(v8::Value* obj);
1787 };
1788
1789
1790 /**
1791 * An instance of the built-in Boolean constructor (ECMA-262, 15.6).
1792 */
1793 class BooleanObject : public Object {
1794 public:
1795 V8EXPORT static Local<Value> New(bool value);
1796
1797 /**
1798 * A specialization of Value::BooleanValue that is more efficient
1799 * because we know the structure of this object.
1800 */
1801 V8EXPORT bool BooleanValue() const;
1802
1803 static inline BooleanObject* Cast(v8::Value* obj);
1804
1805 private:
1806 V8EXPORT static void CheckCast(v8::Value* obj);
1807 };
1808
1809
1810 /**
1811 * An instance of the built-in String constructor (ECMA-262, 15.5).
1812 */
1813 class StringObject : public Object {
1814 public:
1815 V8EXPORT static Local<Value> New(Handle<String> value);
1816
1817 /**
1818 * Returns the String held by the object.
1819 */
1820 V8EXPORT Local<String> StringValue() const;
1821
1822 static inline StringObject* Cast(v8::Value* obj);
1823
1824 private:
1825 V8EXPORT static void CheckCast(v8::Value* obj);
1826 };
1827
1828
1829 /**
1748 * An instance of the built-in RegExp constructor (ECMA-262, 15.10). 1830 * An instance of the built-in RegExp constructor (ECMA-262, 15.10).
1749 */ 1831 */
1750 class RegExp : public Object { 1832 class RegExp : public Object {
1751 public: 1833 public:
1752 /** 1834 /**
1753 * Regular expression flag bits. They can be or'ed to enable a set 1835 * Regular expression flag bits. They can be or'ed to enable a set
1754 * of flags. 1836 * of flags.
1755 */ 1837 */
1756 enum Flags { 1838 enum Flags {
1757 kNone = 0, 1839 kNone = 0,
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after
4028 4110
4029 4111
4030 Date* Date::Cast(v8::Value* value) { 4112 Date* Date::Cast(v8::Value* value) {
4031 #ifdef V8_ENABLE_CHECKS 4113 #ifdef V8_ENABLE_CHECKS
4032 CheckCast(value); 4114 CheckCast(value);
4033 #endif 4115 #endif
4034 return static_cast<Date*>(value); 4116 return static_cast<Date*>(value);
4035 } 4117 }
4036 4118
4037 4119
4120 StringObject* StringObject::Cast(v8::Value* value) {
4121 #ifdef V8_ENABLE_CHECKS
4122 CheckCast(value);
4123 #endif
4124 return static_cast<StringObject*>(value);
4125 }
4126
4127
4128 NumberObject* NumberObject::Cast(v8::Value* value) {
4129 #ifdef V8_ENABLE_CHECKS
4130 CheckCast(value);
4131 #endif
4132 return static_cast<NumberObject*>(value);
4133 }
4134
4135
4136 BooleanObject* BooleanObject::Cast(v8::Value* value) {
4137 #ifdef V8_ENABLE_CHECKS
4138 CheckCast(value);
4139 #endif
4140 return static_cast<BooleanObject*>(value);
4141 }
4142
4143
4038 RegExp* RegExp::Cast(v8::Value* value) { 4144 RegExp* RegExp::Cast(v8::Value* value) {
4039 #ifdef V8_ENABLE_CHECKS 4145 #ifdef V8_ENABLE_CHECKS
4040 CheckCast(value); 4146 CheckCast(value);
4041 #endif 4147 #endif
4042 return static_cast<RegExp*>(value); 4148 return static_cast<RegExp*>(value);
4043 } 4149 }
4044 4150
4045 4151
4046 Object* Object::Cast(v8::Value* value) { 4152 Object* Object::Cast(v8::Value* value) {
4047 #ifdef V8_ENABLE_CHECKS 4153 #ifdef V8_ENABLE_CHECKS
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
4103 4209
4104 4210
4105 } // namespace v8 4211 } // namespace v8
4106 4212
4107 4213
4108 #undef V8EXPORT 4214 #undef V8EXPORT
4109 #undef TYPE_CHECK 4215 #undef TYPE_CHECK
4110 4216
4111 4217
4112 #endif // V8_H_ 4218 #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