Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 0613d5861ca2246a1d187ff2331d05ce9930902b..9ee1687d69e080689bcd66f69ca39d7c5de59678 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -1359,6 +1359,36 @@ class Date : public Value { |
}; |
+/** |
+ * An instance of the built-in RegExp constructor (ECMA-262, 15.10). |
+ */ |
+class RegExp : public Value { |
+ public: |
+ enum Flags { |
+ kNone = 0, |
+ kGlobal = 1, |
+ kIgnoreCase = 2, |
+ kMultiline = 4 |
+ }; |
+ |
+ V8EXPORT static Local<RegExp> New(Handle<String> pattern, |
Mads Ager (chromium)
2010/10/05 08:55:46
Could you add comments to this method as well. You
|
+ Flags flags); |
+ |
+ /** |
+ * Returns the value of the source property: a string representing |
+ * the regular expression. |
+ */ |
+ V8EXPORT Local<String> GetSource() const; |
+ |
+ V8EXPORT Flags GetFlags() const; |
Mads Ager (chromium)
2010/10/05 08:55:46
Could you add comments to this method as well?
|
+ |
+ static inline RegExp* Cast(v8::Value* obj); |
+ |
+ private: |
+ V8EXPORT static void CheckCast(v8::Value* obj); |
+}; |
+ |
+ |
enum PropertyAttribute { |
None = 0, |
ReadOnly = 1 << 0, |
@@ -3617,6 +3647,14 @@ Date* Date::Cast(v8::Value* value) { |
} |
+RegExp* RegExp::Cast(v8::Value* value) { |
+#ifdef V8_ENABLE_CHECKS |
+ CheckCast(value); |
+#endif |
+ return static_cast<RegExp*>(value); |
+} |
+ |
+ |
Object* Object::Cast(v8::Value* value) { |
#ifdef V8_ENABLE_CHECKS |
CheckCast(value); |