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

Unified Diff: src/api.cc

Issue 460333002: Expose Value::IsArgumentsObject in V8 API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 538071af1924a2dd24b627a6bcfb813a9bcfc2fc..00db4e316e00e2bc965f70d3e825ab2da9b65242 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2383,6 +2383,14 @@ bool Value::IsNumber() const {
}
+bool Value::IsArgumentsObject() const {
+ i::Handle<i::Object> obj = Utils::OpenHandle(this);
+ if (!obj->IsHeapObject()) return false;
+ i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate();
+ return obj->HasSpecificClassOf(isolate->heap()->Arguments_string());
Yang 2014/08/12 10:53:46 I don't think this is fool-proof. You could always
+}
+
+
bool Value::IsBoolean() const {
return Utils::OpenHandle(this)->IsBoolean();
}
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698