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

Unified Diff: include/v8.h

Issue 3585010: API: expose RegExp. (Closed)
Patch Set: Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.h » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | src/api.h » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698