| 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 = | 157 Handle<JSFunction> fun = Handle<JSFunction>::cast( |
| 158 Handle<JSFunction>( | 158 GlobalObject::GetPropertyNoExceptionThrown( |
| 159 JSFunction::cast( | 159 isolate->js_builtins_object(), fmt_str)); |
| 160 isolate->js_builtins_object()-> | |
| 161 GetPropertyNoExceptionThrown(*fmt_str))); | |
| 162 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); | 160 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); |
| 163 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), | 161 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), |
| 164 Handle<Object>(message->arguments(), isolate) }; | 162 Handle<Object>(message->arguments(), isolate) }; |
| 165 | 163 |
| 166 bool caught_exception; | 164 bool caught_exception; |
| 167 Handle<Object> result = | 165 Handle<Object> result = |
| 168 Execution::TryCall(fun, | 166 Execution::TryCall(fun, |
| 169 isolate->js_builtins_object(), | 167 isolate->js_builtins_object(), |
| 170 ARRAY_SIZE(argv), | 168 ARRAY_SIZE(argv), |
| 171 argv, | 169 argv, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 187 | 185 |
| 188 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( | 186 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( |
| 189 Isolate* isolate, | 187 Isolate* isolate, |
| 190 Handle<Object> data) { | 188 Handle<Object> data) { |
| 191 HandleScope scope(isolate); | 189 HandleScope scope(isolate); |
| 192 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); | 190 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); |
| 193 } | 191 } |
| 194 | 192 |
| 195 | 193 |
| 196 } } // namespace v8::internal | 194 } } // namespace v8::internal |
| OLD | NEW |