Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index a7978338058b7e9b37dee0d0c17c90d734d04c1f..3b9bb0a13783fd6829bbffe3a678b6babeeb08c4 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1664,6 +1664,23 @@ bool Object::IsStringObjectWithCharacterAt(uint32_t index) { |
} |
+ |
+void Object::VerifyApiCallResultType() { |
+#if ENABLE_EXTRA_CHECKS |
+ if (!(IsSmi() || |
+ IsString() || |
+ IsSpecObject() || |
+ IsHeapNumber() || |
+ IsUndefined() || |
+ IsTrue() || |
+ IsFalse() || |
+ IsNull())) { |
+ FATAL("API call returned invalid object"); |
+ } |
+#endif // ENABLE_EXTRA_CHECKS |
+} |
+ |
+ |
FixedArrayBase* FixedArrayBase::cast(Object* object) { |
ASSERT(object->IsFixedArray() || object->IsFixedDoubleArray()); |
return reinterpret_cast<FixedArrayBase*>(object); |