Class: StackDeck::Frame::JavaScript

Inherits:
StackDeck::Frame show all
Defined in:
lib/stackdeck/frame.rb

Instance Attribute Summary

Attributes inherited from StackDeck::Frame

#clue, #filename, #function, #lineno

Class Method Summary collapse

Methods inherited from StackDeck::Frame

#boundary?, #context, #context?, #initialize, #language, #same_line?, #to_s

Constructor Details

This class inherits a constructor from StackDeck::Frame

Class Method Details

.parse(str) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/stackdeck/frame.rb', line 85

def self.parse(str)
  if str =~ /^(.*)@(.*?):(\d+|\?)$/
    function = $1
    filename = $2
    lineno = $3.to_i

    return if filename == '' && function =~ /^(apply|call)\(/
    return if filename == '' && function == '' && lineno == 0
    return if function =~ /^__hidden(_[A-Za-z0-9_]*)?\(/
    filename = filename.squeeze('/')

    function.sub!(/\(.*/, '')

    new(function, filename, lineno)
  end
end