OLD | NEW |
1 | 1 |
2 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 2 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 PrintF("%s\n", msg); | 59 PrintF("%s\n", msg); |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 Handle<Object> MessageHandler::MakeMessageObject( | 63 Handle<Object> MessageHandler::MakeMessageObject( |
64 const char* type, | 64 const char* type, |
65 MessageLocation* loc, | 65 MessageLocation* loc, |
66 Vector< Handle<Object> > args, | 66 Vector< Handle<Object> > args, |
67 Handle<String> stack_trace) { | 67 Handle<String> stack_trace) { |
68 // Build error message object | 68 // Build error message object |
69 HandleScope scope; | 69 v8::HandleScope scope; // Instantiate a closeable HandleScope for EscapeFrom. |
70 Handle<Object> type_str = Factory::LookupAsciiSymbol(type); | 70 Handle<Object> type_str = Factory::LookupAsciiSymbol(type); |
71 Handle<Object> array = Factory::NewJSArray(args.length()); | 71 Handle<Object> array = Factory::NewJSArray(args.length()); |
72 for (int i = 0; i < args.length(); i++) | 72 for (int i = 0; i < args.length(); i++) |
73 SetElement(Handle<JSArray>::cast(array), i, args[i]); | 73 SetElement(Handle<JSArray>::cast(array), i, args[i]); |
74 | 74 |
75 Handle<JSFunction> fun(Top::global_context()->make_message_fun()); | 75 Handle<JSFunction> fun(Top::global_context()->make_message_fun()); |
76 int start, end; | 76 int start, end; |
77 Handle<Object> script; | 77 Handle<Object> script; |
78 if (loc) { | 78 if (loc) { |
79 start = loc->start_pos(); | 79 start = loc->start_pos(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) { | 172 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) { |
173 HandleScope scope; | 173 HandleScope scope; |
174 return GetMessage(data)->ToCString(DISALLOW_NULLS); | 174 return GetMessage(data)->ToCString(DISALLOW_NULLS); |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 } } // namespace v8::internal | 178 } } // namespace v8::internal |
OLD | NEW |