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

Unified Diff: src/api.cc

Issue 1003663002: Add Cast() for Int32 and Uint32 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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') | no next file » | 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 f285980f6b654d289e82f62bd4963b3c1ccab1a9..e26f833ed62e18e291f0b8bb172d975e7eee6d18 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2973,6 +2973,18 @@ void v8::Integer::CheckCast(v8::Value* that) {
}
+void v8::Int32::CheckCast(v8::Value* that) {
+ Utils::ApiCheck(that->IsInt32(), "v8::Int32::Cast()",
+ "Could not convert to 32-bit signed integer");
+}
+
+
+void v8::Uint32::CheckCast(v8::Value* that) {
+ Utils::ApiCheck(that->IsUint32(), "v8::Uint32::Cast()",
+ "Could not convert to 32-bit unsigned integer");
+}
+
+
void v8::Array::CheckCast(Value* that) {
i::Handle<i::Object> obj = Utils::OpenHandle(that);
Utils::ApiCheck(obj->IsJSArray(),
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698