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/v8.h" | 5 #include "src/v8.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/heap/spaces-inl.h" | 9 #include "src/heap/spaces-inl.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 } | 125 } |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 Handle<String> MessageHandler::GetMessage(Isolate* isolate, | 130 Handle<String> MessageHandler::GetMessage(Isolate* isolate, |
131 Handle<Object> data) { | 131 Handle<Object> data) { |
132 Factory* factory = isolate->factory(); | 132 Factory* factory = isolate->factory(); |
133 Handle<String> fmt_str = | 133 Handle<String> fmt_str = |
134 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("FormatMessage")); | 134 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("$formatMessage")); |
135 Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty( | 135 Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty( |
136 isolate->js_builtins_object(), fmt_str).ToHandleChecked()); | 136 isolate->js_builtins_object(), fmt_str).ToHandleChecked()); |
137 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); | 137 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); |
138 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), | 138 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), |
139 Handle<Object>(message->arguments(), isolate) }; | 139 Handle<Object>(message->arguments(), isolate) }; |
140 | 140 |
141 MaybeHandle<Object> maybe_result = Execution::TryCall( | 141 MaybeHandle<Object> maybe_result = Execution::TryCall( |
142 fun, isolate->js_builtins_object(), arraysize(argv), argv); | 142 fun, isolate->js_builtins_object(), arraysize(argv), argv); |
143 Handle<Object> result; | 143 Handle<Object> result; |
144 if (!maybe_result.ToHandle(&result) || !result->IsString()) { | 144 if (!maybe_result.ToHandle(&result) || !result->IsString()) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DCHECK(i < arraysize(args)); | 192 DCHECK(i < arraysize(args)); |
193 builder.AppendString(args[i++]); | 193 builder.AppendString(args[i++]); |
194 } else { | 194 } else { |
195 builder.AppendCharacter(*c); | 195 builder.AppendCharacter(*c); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 return builder.Finish(); | 199 return builder.Finish(); |
200 } | 200 } |
201 } } // namespace v8::internal | 201 } } // namespace v8::internal |
OLD | NEW |