Reviewers: jarin,
Description:
Version 3.26.13.1 (merged r20705)
Allow GetScriptNameOrSourceURL to be called with exception pending.
[email protected]
Please review this at https://codereview.chromium.org/236713004/
SVN Base: https://v8.googlecode.com/svn/trunk
Affected files (+19, -5 lines):
M src/handles.cc
M src/version.cc
M test/cctest/test-api.cc
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index
af1ffab59c3b2928da8ea35ebc90d24774dda3ca..f70848f7bb37b23f2049e0bdc1b282bb1ec11b93
100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -399,10 +399,11 @@ Handle<Object>
GetScriptNameOrSourceURL(Handle<Script> script) {
ASSERT(property->IsJSFunction());
Handle<JSFunction> method = Handle<JSFunction>::cast(property);
Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(
- isolate, result,
- Execution::TryCall(method, script_wrapper, 0, NULL),
- isolate->factory()->undefined_value());
+ // Do not check against pending exception, since this function may be
called
+ // when an exception has already been pending.
+ if (!Execution::TryCall(method, script_wrapper, 0,
NULL).ToHandle(&result)) {
+ return isolate->factory()->undefined_value();
+ }
return result;
}
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index
ae0587d48f950fa3290c9668064352a5b049f378..f8b38ab0c02123b836afd277fec114664381b9d0
100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 26
#define BUILD_NUMBER 13
-#define PATCH_LEVEL 0
+#define PATCH_LEVEL 1
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index
309040c7cd1160edddd1404b9aa64e6ffe4550f3..d989f178ed63acd419fa63a0450467ccd99cfb24
100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -22402,3 +22402,16 @@ TEST(Regress354123) {
CompileRun("Object.getPrototypeOf(friend);");
CHECK_EQ(2, named_access_count);
}
+
+
+TEST(CaptureStackTraceForStackOverflow) {
+ v8::internal::FLAG_stack_size = 150;
+ LocalContext current;
+ v8::Isolate* isolate = current->GetIsolate();
+ v8::HandleScope scope(isolate);
+ V8::SetCaptureStackTraceForUncaughtExceptions(
+ true, 10, v8::StackTrace::kDetailed);
+ v8::TryCatch try_catch;
+ CompileRun("(function f(x) { f(x+1); })(0)");
+ CHECK(try_catch.HasCaught());
+}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.