mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: use context-free V8 message column getters
PR-URL: https://github.com/nodejs/node/pull/62778 Refs: https://issues.chromium.org/issues/42210793 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This commit is contained in:
1 parent
ddc8fe02c6
commit
0454a3bb73
2 files changed
+4
-4
No files matched your search
@@ -651,7 +651,7 @@ class NodeInspectorClient : public V8InspectorClient {
|
||||
ToInspectorString(isolate, message->Get())->string(),
|
||||
ToInspectorString(isolate, message->GetScriptResourceName())->string(),
|
||||
message->GetLineNumber(context).FromMaybe(0),
|
||||
message->GetStartColumn(context).FromMaybe(0),
|
||||
message->GetStartColumn(),
|
||||
client_->createStackTrace(stack_trace),
|
||||
script_id);
|
||||
}
|
||||
|
||||
+3
-3
@@ -65,7 +65,7 @@ static std::string GetSourceMapErrorSource(Isolate* isolate,
|
||||
// the source texts.
|
||||
Local<Value> script_resource_name = message->GetScriptResourceName();
|
||||
int linenum = message->GetLineNumber(context).FromJust();
|
||||
int columnum = message->GetStartColumn(context).FromJust();
|
||||
int columnum = message->GetStartColumn();
|
||||
|
||||
Local<Value> argv[] = {script_resource_name,
|
||||
v8::Int32::New(isolate, linenum),
|
||||
@@ -148,8 +148,8 @@ static std::string GetErrorSource(Isolate* isolate,
|
||||
int script_start = (linenum - origin.LineOffset()) == 1
|
||||
? origin.ColumnOffset()
|
||||
: 0;
|
||||
int start = message->GetStartColumn(context).FromMaybe(0);
|
||||
int end = message->GetEndColumn(context).FromMaybe(0);
|
||||
int start = message->GetStartColumn();
|
||||
int end = message->GetEndColumn();
|
||||
if (start >= script_start) {
|
||||
CHECK_GE(end, start);
|
||||
start -= script_start;
|
||||
|
||||
Reference in new issue
Block a user