# File lib/envjs.rb, line 5 def self.js_exception_stack e result = %Q(Exception: )+e.to_s e.stack.to_s.split(%Q(\n)).each do |line| next if line == "@:0" m = line.match(/(.*)@([^@]*)$/) s = m[1] limit = 50 if ( s.length > limit ) s = s[0,limit] + %Q(...) end result += "\n" + m[2]+%Q( )+s end result end