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

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: Adapted to Yang's feedback Created 5 years, 1 month 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
« src/bootstrapper.cc ('K') | « src/contexts.h ('k') | src/counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index 9da13fe9e8a00665090f207aa7c6d7066d234bb4..d5cbf21cb7b33605b5657b567955925b933184aa 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -577,5 +577,18 @@ bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
}
#endif
+
+void Context::IncrementErrorsThrown() {
+ DCHECK(IsNativeContext());
+
+ int previous_value = errors_thrown()->value();
+ set_errors_thrown(Smi::FromInt(previous_value+1));
Yang 2015/11/05 07:50:01 I think "git cl format" would add spaces around +.
Michael Hablich 2015/11/05 13:23:11 Done.
+}
+
+
+int Context::GetErrorsThrown() {
+ return errors_thrown()->value();
+}
+
} // namespace internal
} // namespace v8
« src/bootstrapper.cc ('K') | « src/contexts.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698