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

Unified Diff: src/contexts.cc

Issue 1413503007: Provide a counter for thrown JavaScript errors per context (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moved counting from creation to throwing again Created 5 years, 2 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
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index a18f181bef8ccb3e0ca80d43dc5a1f3107105d73..b599971ab979a2d50f50c8c026789f4f508ccdca 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -589,5 +589,18 @@ bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
}
#endif
+
+void Context::IncrementErrorsThrown() {
+ DCHECK(IsNativeContext());
+
+ int previous_value = Smi::cast(errors_thrown())->value();
Yang 2015/11/02 05:48:57 this cast would be unnecessary if the type of this
Michael Hablich 2015/11/04 10:58:07 Done.
+ set_errors_thrown(Smi::FromInt(previous_value+1));
+}
+
+
+int Context::GetErrorsThrown() {
+ return Smi::cast(errors_thrown())->value();
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698