|
102 | 102 | var functionName = tokens.join(' ') || undefined; |
103 | 103 | var fileName = _indexOf(['eval', '<anonymous>'], locationParts[0]) > -1 ? undefined : locationParts[0]; |
104 | 104 |
|
105 | | - return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line); |
| 105 | + return new StackFrame({ |
| 106 | + functionName: functionName, |
| 107 | + fileName: fileName, |
| 108 | + lineNumber: locationParts[1], |
| 109 | + columnNumber: locationParts[2], |
| 110 | + source: line |
| 111 | + }); |
106 | 112 | }, this); |
107 | 113 | }, |
108 | 114 |
|
|
119 | 125 |
|
120 | 126 | if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { |
121 | 127 | // Safari eval frames only have function names and nothing else |
122 | | - return new StackFrame(line); |
| 128 | + return new StackFrame({ |
| 129 | + functionName: line |
| 130 | + }); |
123 | 131 | } else { |
124 | 132 | var tokens = line.split('@'); |
125 | 133 | var locationParts = this.extractLocation(tokens.pop()); |
126 | 134 | var functionName = tokens.join('@') || undefined; |
127 | | - return new StackFrame(functionName, |
128 | | - undefined, |
129 | | - locationParts[0], |
130 | | - locationParts[1], |
131 | | - locationParts[2], |
132 | | - line); |
| 135 | + |
| 136 | + return new StackFrame({ |
| 137 | + functionName: functionName, |
| 138 | + fileName: locationParts[0], |
| 139 | + lineNumber: locationParts[1], |
| 140 | + columnNumber: locationParts[2], |
| 141 | + source: line |
| 142 | + }); |
133 | 143 | } |
134 | 144 | }, this); |
135 | 145 | }, |
|
153 | 163 | for (var i = 2, len = lines.length; i < len; i += 2) { |
154 | 164 | var match = lineRE.exec(lines[i]); |
155 | 165 | if (match) { |
156 | | - result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i])); |
| 166 | + result.push(new StackFrame({ |
| 167 | + fileName: match[2], |
| 168 | + lineNumber: match[1], |
| 169 | + source: lines[i] |
| 170 | + })); |
157 | 171 | } |
158 | 172 | } |
159 | 173 |
|
|
169 | 183 | var match = lineRE.exec(lines[i]); |
170 | 184 | if (match) { |
171 | 185 | result.push( |
172 | | - new StackFrame( |
173 | | - match[3] || undefined, |
174 | | - undefined, |
175 | | - match[2], |
176 | | - match[1], |
177 | | - undefined, |
178 | | - lines[i] |
179 | | - ) |
| 186 | + new StackFrame({ |
| 187 | + functionName: match[3] || undefined, |
| 188 | + fileName: match[2], |
| 189 | + lineNumber: match[1], |
| 190 | + source: lines[i] |
| 191 | + }) |
180 | 192 | ); |
181 | 193 | } |
182 | 194 | } |
|
203 | 215 | } |
204 | 216 | var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? |
205 | 217 | undefined : argsRaw.split(','); |
206 | | - return new StackFrame( |
207 | | - functionName, |
208 | | - args, |
209 | | - locationParts[0], |
210 | | - locationParts[1], |
211 | | - locationParts[2], |
212 | | - line); |
| 218 | + |
| 219 | + return new StackFrame({ |
| 220 | + functionName: functionName, |
| 221 | + args: args, |
| 222 | + fileName: locationParts[0], |
| 223 | + lineNumber: locationParts[1], |
| 224 | + columnNumber: locationParts[2], |
| 225 | + source: line |
| 226 | + }); |
213 | 227 | }, this); |
214 | 228 | } |
215 | 229 | }; |
216 | 230 | })); |
217 | | - |
|
0 commit comments