OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/messages.h" | 5 #include "src/messages.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/keys.h" | 10 #include "src/keys.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 isolate->set_external_caught_exception(false); | 91 isolate->set_external_caught_exception(false); |
92 | 92 |
93 // Turn the exception on the message into a string if it is an object. | 93 // Turn the exception on the message into a string if it is an object. |
94 if (message->argument()->IsJSObject()) { | 94 if (message->argument()->IsJSObject()) { |
95 HandleScope scope(isolate); | 95 HandleScope scope(isolate); |
96 Handle<Object> argument(message->argument(), isolate); | 96 Handle<Object> argument(message->argument(), isolate); |
97 | 97 |
98 MaybeHandle<Object> maybe_stringified; | 98 MaybeHandle<Object> maybe_stringified; |
99 Handle<Object> stringified; | 99 Handle<Object> stringified; |
100 // Make sure we don't leak uncaught internally generated Error objects. | 100 // Make sure we don't leak uncaught internally generated Error objects. |
101 if (Object::IsErrorObject(isolate, argument)) { | 101 if (argument->IsJSError()) { |
102 Handle<Object> args[] = {argument}; | 102 Handle<Object> args[] = {argument}; |
103 maybe_stringified = Execution::TryCall( | 103 maybe_stringified = Execution::TryCall( |
104 isolate, isolate->no_side_effects_to_string_fun(), | 104 isolate, isolate->no_side_effects_to_string_fun(), |
105 isolate->factory()->undefined_value(), arraysize(args), args); | 105 isolate->factory()->undefined_value(), arraysize(args), args); |
106 } else { | 106 } else { |
107 v8::TryCatch catcher(reinterpret_cast<v8::Isolate*>(isolate)); | 107 v8::TryCatch catcher(reinterpret_cast<v8::Isolate*>(isolate)); |
108 catcher.SetVerbose(false); | 108 catcher.SetVerbose(false); |
109 catcher.SetCaptureMessage(false); | 109 catcher.SetCaptureMessage(false); |
110 | 110 |
111 maybe_stringified = Object::ToString(isolate, argument); | 111 maybe_stringified = Object::ToString(isolate, argument); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 builder.AppendCharacter(*c); | 439 builder.AppendCharacter(*c); |
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 return builder.Finish(); | 443 return builder.Finish(); |
444 } | 444 } |
445 | 445 |
446 | 446 |
447 } // namespace internal | 447 } // namespace internal |
448 } // namespace v8 | 448 } // namespace v8 |
OLD | NEW |