@@ -513,6 +513,26 @@ int JSStackFrame::GetColumnNumber() {
513
513
return kNone ;
514
514
}
515
515
516
+ int JSStackFrame::GetEnclosingLineNumber () {
517
+ if (HasScript ()) {
518
+ Handle <SharedFunctionInfo> shared = handle (function_->shared (), isolate_);
519
+ return Script::GetLineNumber (GetScript (),
520
+ shared->function_token_position ()) + 1 ;
521
+ } else {
522
+ return kNone ;
523
+ }
524
+ }
525
+
526
+ int JSStackFrame::GetEnclosingColumnNumber () {
527
+ if (HasScript ()) {
528
+ Handle <SharedFunctionInfo> shared = handle (function_->shared (), isolate_);
529
+ return Script::GetColumnNumber (GetScript (),
530
+ shared->function_token_position ()) + 1 ;
531
+ } else {
532
+ return kNone ;
533
+ }
534
+ }
535
+
516
536
int JSStackFrame::GetPromiseIndex () const {
517
537
return is_promise_all_ ? offset_ : kNone ;
518
538
}
@@ -601,6 +621,12 @@ int WasmStackFrame::GetPosition() const {
601
621
602
622
int WasmStackFrame::GetColumnNumber () { return GetModuleOffset (); }
603
623
624
+ int WasmStackFrame::GetEnclosingColumnNumber () {
625
+ const int function_offset =
626
+ GetWasmFunctionOffset (wasm_instance_->module (), wasm_func_index_);
627
+ return function_offset;
628
+ }
629
+
604
630
int WasmStackFrame::GetModuleOffset () const {
605
631
const int function_offset =
606
632
GetWasmFunctionOffset (wasm_instance_->module (), wasm_func_index_);
@@ -669,6 +695,26 @@ int AsmJsWasmStackFrame::GetColumnNumber() {
669
695
return Script::GetColumnNumber (script, GetPosition ()) + 1 ;
670
696
}
671
697
698
+ int AsmJsWasmStackFrame::GetEnclosingLineNumber () {
699
+ DCHECK_LE (0 , GetPosition ());
700
+ Handle <Script> script (wasm_instance_->module_object ().script (), isolate_);
701
+ DCHECK (script->IsUserJavaScript ());
702
+ int byte_offset = GetSourcePosition (wasm_instance_->module (),
703
+ wasm_func_index_, 0 ,
704
+ is_at_number_conversion_);
705
+ return Script::GetLineNumber (script, byte_offset) + 1 ;
706
+ }
707
+
708
+ int AsmJsWasmStackFrame::GetEnclosingColumnNumber () {
709
+ DCHECK_LE (0 , GetPosition ());
710
+ Handle <Script> script (wasm_instance_->module_object ().script (), isolate_);
711
+ DCHECK (script->IsUserJavaScript ());
712
+ int byte_offset = GetSourcePosition (wasm_instance_->module (),
713
+ wasm_func_index_, 0 ,
714
+ is_at_number_conversion_);
715
+ return Script::GetColumnNumber (script, byte_offset) + 1 ;
716
+ }
717
+
672
718
FrameArrayIterator::FrameArrayIterator (Isolate* isolate,
673
719
Handle <FrameArray> array, int frame_ix)
674
720
: isolate_(isolate), array_(array), frame_ix_(frame_ix) {}
0 commit comments