Skip to content

Commit 30d8689

Browse files
committed
Fix remaining JSCS issues.
1 parent 0f616af commit 30d8689

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

error-stack-parser.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
return {
4747
/**
4848
* Given an Error object, extract the most information from it.
49-
* @param error {Error}
50-
* @return Array[StackFrame]
49+
*
50+
* @param {Error} error object
51+
* @return {Array} of StackFrames
5152
*/
5253
parse: function ErrorStackParser$$parse(error) {
5354
if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {
@@ -63,8 +64,9 @@
6364

6465
/**
6566
* Separate line and column numbers from a URL-like string.
66-
* @param urlLike String
67-
* @return Array[String]
67+
*
68+
* @param {String} urlLike
69+
* @return {Array} 3-tuple of URL, Line Number, and Column Number
6870
*/
6971
extractLocation: function ErrorStackParser$$extractLocation(urlLike) {
7072
// Fail-fast but return locations like "(native)"
@@ -120,7 +122,12 @@
120122
var tokens = line.split('@');
121123
var locationParts = this.extractLocation(tokens.pop());
122124
var functionName = tokens.join('@') || undefined;
123-
return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);
125+
return new StackFrame(functionName,
126+
undefined,
127+
locationParts[0],
128+
locationParts[1],
129+
locationParts[2],
130+
line);
124131
}
125132
}, this);
126133
},
@@ -159,7 +166,16 @@
159166
for (var i = 0, len = lines.length; i < len; i += 2) {
160167
var match = lineRE.exec(lines[i]);
161168
if (match) {
162-
result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));
169+
result.push(
170+
new StackFrame(
171+
match[3] || undefined,
172+
undefined,
173+
match[2],
174+
match[1],
175+
undefined,
176+
lines[i]
177+
)
178+
);
163179
}
164180
}
165181

@@ -183,8 +199,15 @@
183199
if (functionCall.match(/\(([^\)]*)\)/)) {
184200
argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
185201
}
186-
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');
187-
return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);
202+
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
203+
undefined : argsRaw.split(',');
204+
return new StackFrame(
205+
functionName,
206+
args,
207+
locationParts[0],
208+
locationParts[1],
209+
locationParts[2],
210+
line);
188211
}, this);
189212
}
190213
};

0 commit comments

Comments
 (0)