File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,10 +148,9 @@ static std::string GetErrorSource(Isolate* isolate,
148148 int script_start = (linenum - origin.LineOffset ()) == 1
149149 ? origin.ColumnOffset ()
150150 : 0 ;
151- int start = message->GetStartColumn ();
152- int end = message->GetEndColumn ();
153- if (start >= script_start) {
154- CHECK_GE (end, start);
151+ int start = message->GetStartColumn (context).FromMaybe (0 );
152+ int end = message->GetEndColumn (context).FromMaybe (0 );
153+ if (start >= script_start && end >= script_start) {
155154 start -= script_start;
156155 end -= script_start;
157156 }
@@ -161,8 +160,7 @@ static std::string GetErrorSource(Isolate* isolate,
161160 CHECK_GT (buf.size (), 0 );
162161 *added_exception_line = true ;
163162
164- if (start > end ||
165- start < 0 ||
163+ if (start > end || start < 0 || end < 0 ||
166164 static_cast <size_t >(end) > sourceline.size ()) {
167165 return buf;
168166 }
You can’t perform that action at this time.
0 commit comments