Commit 59645c6a authored by antonm@chromium.org's avatar antonm@chromium.org

Add v8::Value::IsRegExp method.

Patch by Vlad Burlik.

Review URL: http://codereview.chromium.org/3064051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 64eade00
......@@ -29,4 +29,5 @@ Rodolph Perfetta <rodolph.perfetta@arm.com>
Ryan Dahl <coldredlemur@gmail.com>
Subrato K De <subratokde@codeaurora.org>
Burcu Dogan <burcujdogan@gmail.com>
Vlad Burlik <vladbph@gmail.com>
......@@ -919,6 +919,11 @@ class Value : public Data {
*/
V8EXPORT bool IsDate() const;
/**
* Returns true if this value is a RegExp.
*/
V8EXPORT bool IsRegExp() const;
V8EXPORT Local<Boolean> ToBoolean() const;
V8EXPORT Local<Number> ToNumber() const;
V8EXPORT Local<String> ToString() const;
......
......@@ -1792,6 +1792,13 @@ bool Value::IsDate() const {
}
bool Value::IsRegExp() const {
if (IsDeadCheck("v8::Value::IsRegExp()")) return false;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
return obj->IsJSRegExp();
}
Local<String> Value::ToString() const {
if (IsDeadCheck("v8::Value::ToString()")) return Local<String>();
LOG_API("ToString");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment