24 {
25 const char* message_header;
26 switch (kind) {
28 message_header = "warning";
29 break;
31 message_header = "error";
32 break;
34 message_header = "bailout";
35 break;
36 default:
37 message_header = "";
39 }
43 intptr_t
line, column;
44 if (
script.GetTokenLocation(token_pos, &
line, &column)) {
45 const intptr_t token_len =
script.GetTokenLength(token_pos);
46 if (report_after_token) {
47 column += token_len < 0 ? 1 : token_len;
48 }
49
50
51
54 script_url.ToCString(), message_header,
line, column);
55
59
60 const String& script_line =
62 ASSERT(!script_line.IsNull());
64 strs.SetAt(3, script_line);
66
68 Heap::kOld,
"%*s\n",
static_cast<int>(column),
"^"));
69 strs.SetAt(5, column_line);
71 } else {
72
74 Heap::kOld,
"'%s': %s: ", script_url.ToCString(), message_header);
76 }
77 } else {
78
79
82 }
84}
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static StringPtr NewFormatted(const char *format,...) PRINTF_ATTRIBUTE(1
static StringPtr ConcatAll(const Array &strings, Heap::Space space=Heap::kNew)
static StringPtr Concat(const String &str1, const String &str2, Heap::Space space=Heap::kNew)
static const String & NewLine()