Index: src/messages.h |
diff --git a/src/messages.h b/src/messages.h |
index 529c659e181d8f35cca3e05909d8e3a76fa9a3b4..d00eec0fc2131c5740f40103b0ac6a4bc864dcf4 100644 |
--- a/src/messages.h |
+++ b/src/messages.h |
@@ -457,6 +457,46 @@ class MessageHandler { |
static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
Handle<Object> data); |
}; |
+ |
+ |
+class ErrorToStringHelper { |
+ public: |
+ ErrorToStringHelper() : visited_(0) {} |
+ |
+ MUST_USE_RESULT MaybeHandle<String> Stringify(Isolate* isolate, |
+ Handle<JSObject> error); |
+ |
+ private: |
+ class VisitedScope { |
+ public: |
+ VisitedScope(ErrorToStringHelper* helper, Handle<JSObject> error) |
+ : helper_(helper), has_visited_(false) { |
+ for (const Handle<JSObject>& visited : helper->visited_) { |
+ if (visited.is_identical_to(error)) { |
+ has_visited_ = true; |
+ break; |
+ } |
+ } |
+ helper->visited_.Add(error); |
+ } |
+ ~VisitedScope() { helper_->visited_.RemoveLast(); } |
+ bool has_visited() { return has_visited_; } |
+ |
+ private: |
+ ErrorToStringHelper* helper_; |
+ bool has_visited_; |
+ }; |
+ |
+ static bool ShadowsInternalError(Isolate* isolate, |
+ LookupIterator* property_lookup, |
+ LookupIterator* internal_error_lookup); |
+ |
+ static MUST_USE_RESULT MaybeHandle<String> GetStringifiedProperty( |
+ Isolate* isolate, LookupIterator* property_lookup, |
+ Handle<String> default_value); |
+ |
+ List<Handle<JSObject> > visited_; |
+}; |
} } // namespace v8::internal |
#endif // V8_MESSAGES_H_ |