Attached you will find a little path to support IsRegExp in C++ API. I'm not
familiar with the v8 contribution process. If somebody can review it, thank
you.

Camilo Aguilar

On Fri, May 7, 2010 at 8:24 PM, vlad <[email protected]> wrote:

> Hi,
> It appears that RegExp is not exposed to c++... Is there any work
> around?
>
> Ideally it would be good to have v8::RegExp::New("...");
>
> Thanks
> Vlad
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
Index: include/v8.h
===================================================================
--- include/v8.h	(revision 4619)
+++ include/v8.h	(working copy)
@@ -844,6 +844,11 @@
   bool IsArray() const;
 
   /**
+   * Returns true if this value is an regexp.
+   */
+  bool IsRegExp() const;
+
+  /**
    * Returns true if this value is an object.
    */
   bool IsObject() const;
Index: src/api.cc
===================================================================
--- src/api.cc	(revision 4619)
+++ src/api.cc	(working copy)
@@ -1682,6 +1682,10 @@
   return Utils::OpenHandle(this)->IsJSArray();
 }
 
+bool Value::IsRegExp() const {
+  if (IsDeadCheck("v8::Value::IsRegExp()")) return false;
+  return Utils::OpenHandle(this)->IsJSRegExp();
+}
 
 bool Value::IsObject() const {
   if (IsDeadCheck("v8::Value::IsObject()")) return false;

Reply via email to