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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 break; | 182 break; |
183 } | 183 } |
184 | 184 |
185 Isolate* isolate = arg0->GetIsolate(); | 185 Isolate* isolate = arg0->GetIsolate(); |
186 IncrementalStringBuilder builder(isolate); | 186 IncrementalStringBuilder builder(isolate); |
187 | 187 |
188 unsigned int i = 0; | 188 unsigned int i = 0; |
189 Handle<String> args[] = {arg0, arg1, arg2}; | 189 Handle<String> args[] = {arg0, arg1, arg2}; |
190 for (const char* c = template_string; *c != '\0'; c++) { | 190 for (const char* c = template_string; *c != '\0'; c++) { |
191 if (*c == '%') { | 191 if (*c == '%') { |
| 192 DCHECK(i < arraysize(args)); |
192 builder.AppendString(args[i++]); | 193 builder.AppendString(args[i++]); |
193 DCHECK(i < arraysize(args)); | |
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 |