Skip to content

Commit 42f6621

Browse files
Fixes #51 - exception does not have arguments property in Chrome 27
1 parent d8e8e0b commit 42f6621

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

stacktrace.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ printStackTrace.implementation.prototype = {
8484
}
8585
// e.stacktrace && e.stack -> opera11
8686
return 'opera11'; // use e.stacktrace, format differs from 'opera10a', 'opera10b'
87+
} else if (e.stack && !e.fileName) {
88+
// Chrome 27 does not have e.arguments as earlier versions,
89+
// but still does not have e.fileName as Firefox
90+
return 'chrome';
8791
} else if (e.stack) {
8892
return 'firefox';
8993
}
@@ -96,7 +100,7 @@ printStackTrace.implementation.prototype = {
96100
*
97101
* @param {Object} context of execution (e.g. window)
98102
* @param {String} functionName to instrument
99-
* @param {Function} function to call with a stack trace on invocation
103+
* @param {Function} callback function to call with a stack trace on invocation
100104
*/
101105
instrumentFunction: function(context, functionName, callback) {
102106
context = context || window;
@@ -264,10 +268,10 @@ printStackTrace.implementation.prototype = {
264268
},
265269

266270
/**
267-
* Given arguments array as a String, subsituting type names for non-string types.
271+
* Given arguments array as a String, substituting type names for non-string types.
268272
*
269-
* @param {Arguments} args
270-
* @return {Array} of Strings with stringified arguments
273+
* @param {Arguments,Array} args
274+
* @return {String} stringified arguments
271275
*/
272276
stringifyArguments: function(args) {
273277
var result = [];
@@ -353,7 +357,7 @@ printStackTrace.implementation.prototype = {
353357
* via Ajax).
354358
*
355359
* @param url <String> source url
356-
* @return False if we need a cross-domain request
360+
* @return <Boolean> False if we need a cross-domain request
357361
*/
358362
isSameDomain: function(url) {
359363
return typeof location !== "undefined" && url.indexOf(location.hostname) !== -1; // location may not be defined, e.g. when running from nodejs.

0 commit comments

Comments
 (0)