OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 } else { | 1136 } else { |
1137 Handle<Object> message_obj = CreateMessage(exception_handle, location); | 1137 Handle<Object> message_obj = CreateMessage(exception_handle, location); |
1138 thread_local_top()->pending_message_obj_ = *message_obj; | 1138 thread_local_top()->pending_message_obj_ = *message_obj; |
1139 | 1139 |
1140 // For any exception not caught by JavaScript, even when an external | 1140 // For any exception not caught by JavaScript, even when an external |
1141 // handler is present: | 1141 // handler is present: |
1142 // If the abort-on-uncaught-exception flag is specified, and if the | 1142 // If the abort-on-uncaught-exception flag is specified, and if the |
1143 // embedder didn't specify a custom uncaught exception callback, | 1143 // embedder didn't specify a custom uncaught exception callback, |
1144 // or if the custom callback determined that V8 should abort, then | 1144 // or if the custom callback determined that V8 should abort, then |
1145 // abort. | 1145 // abort. |
1146 CatchType prediction = PredictExceptionCatcher(); | 1146 if (FLAG_abort_on_uncaught_exception) { |
1147 if (FLAG_abort_on_uncaught_exception && | 1147 CatchType prediction = PredictExceptionCatcher(); |
1148 (prediction == NOT_CAUGHT || prediction == CAUGHT_BY_EXTERNAL) && | 1148 if ((prediction == NOT_CAUGHT || prediction == CAUGHT_BY_EXTERNAL) && |
1149 (!abort_on_uncaught_exception_callback_ || | 1149 (!abort_on_uncaught_exception_callback_ || |
1150 abort_on_uncaught_exception_callback_( | 1150 abort_on_uncaught_exception_callback_( |
1151 reinterpret_cast<v8::Isolate*>(this)))) { | 1151 reinterpret_cast<v8::Isolate*>(this)))) { |
1152 // Prevent endless recursion. | 1152 // Prevent endless recursion. |
1153 FLAG_abort_on_uncaught_exception = false; | 1153 FLAG_abort_on_uncaught_exception = false; |
1154 // This flag is intended for use by JavaScript developers, so | 1154 // This flag is intended for use by JavaScript developers, so |
1155 // print a user-friendly stack trace (not an internal one). | 1155 // print a user-friendly stack trace (not an internal one). |
1156 PrintF(stderr, "%s\n\nFROM\n", | 1156 PrintF(stderr, "%s\n\nFROM\n", |
1157 MessageHandler::GetLocalizedMessage(this, message_obj).get()); | 1157 MessageHandler::GetLocalizedMessage(this, message_obj).get()); |
1158 PrintCurrentStackTrace(stderr); | 1158 PrintCurrentStackTrace(stderr); |
1159 base::OS::Abort(); | 1159 base::OS::Abort(); |
| 1160 } |
1160 } | 1161 } |
1161 } | 1162 } |
1162 } | 1163 } |
1163 | 1164 |
1164 // Set the exception being thrown. | 1165 // Set the exception being thrown. |
1165 set_pending_exception(*exception_handle); | 1166 set_pending_exception(*exception_handle); |
1166 return heap()->exception(); | 1167 return heap()->exception(); |
1167 } | 1168 } |
1168 | 1169 |
1169 | 1170 |
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3205 // Then check whether this scope intercepts. | 3206 // Then check whether this scope intercepts. |
3206 if ((flag & intercept_mask_)) { | 3207 if ((flag & intercept_mask_)) { |
3207 intercepted_flags_ |= flag; | 3208 intercepted_flags_ |= flag; |
3208 return true; | 3209 return true; |
3209 } | 3210 } |
3210 return false; | 3211 return false; |
3211 } | 3212 } |
3212 | 3213 |
3213 } // namespace internal | 3214 } // namespace internal |
3214 } // namespace v8 | 3215 } // namespace v8 |
OLD | NEW |