OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 | 151 |
152 Handle<String> MessageHandler::GetMessage(Isolate* isolate, | 152 Handle<String> MessageHandler::GetMessage(Isolate* isolate, |
153 Handle<Object> data) { | 153 Handle<Object> data) { |
154 Factory* factory = isolate->factory(); | 154 Factory* factory = isolate->factory(); |
155 Handle<String> fmt_str = | 155 Handle<String> fmt_str = |
156 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("FormatMessage")); | 156 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("FormatMessage")); |
157 Handle<JSFunction> fun = Handle<JSFunction>::cast( | 157 Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty( |
158 GlobalObject::GetPropertyNoExceptionThrown( | 158 isolate->js_builtins_object(), fmt_str).ToHandleChecked()); |
159 isolate->js_builtins_object(), fmt_str)); | |
160 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); | 159 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); |
161 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), | 160 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), |
162 Handle<Object>(message->arguments(), isolate) }; | 161 Handle<Object>(message->arguments(), isolate) }; |
163 | 162 |
164 bool caught_exception; | 163 bool caught_exception; |
165 Handle<Object> result = | 164 Handle<Object> result = |
166 Execution::TryCall(fun, | 165 Execution::TryCall(fun, |
167 isolate->js_builtins_object(), | 166 isolate->js_builtins_object(), |
168 ARRAY_SIZE(argv), | 167 ARRAY_SIZE(argv), |
169 argv, | 168 argv, |
(...skipping 15 matching lines...) Expand all Loading... |
185 | 184 |
186 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( | 185 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( |
187 Isolate* isolate, | 186 Isolate* isolate, |
188 Handle<Object> data) { | 187 Handle<Object> data) { |
189 HandleScope scope(isolate); | 188 HandleScope scope(isolate); |
190 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); | 189 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); |
191 } | 190 } |
192 | 191 |
193 | 192 |
194 } } // namespace v8::internal | 193 } } // namespace v8::internal |
OLD | NEW |