Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b9c503

Browse files
authored
Deferred: Respect source maps in jQuery.Deferred.exceptionHook
So far, `jQuery.Deferred.exceptionHook` used to log error message and stackseparately. However, that breaks browser applying source maps against the stacktrace - most browsers require logging an error instance. This change makes usdo exactly that.One drawback of the change is that in IE 11 previously stack was printeddirectly and now just the error summary; to get to the actual stacktrace, three clicks are required. This seems to be a low price to payfor having source maps work in all the other browsers, though.Safari with the new change requires one click to get to the stack tracewhich sounds manageable.Fixesgh-3179Closesgh-5192Refhttps://crbug.com/622227
1 parent6d13644 commit0b9c503

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/deferred/exceptionHook.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jQuery.Deferred.exceptionHook = function( error, stack ) {
1010

1111
if(error&&rerrorNames.test(error.name)){
1212
window.console.warn(
13-
"jQuery.Deferred exception: "+error.message,
14-
error.stack,
13+
"jQuery.Deferred exception",
14+
error,
1515
stack
1616
);
1717
}

‎test/unit/deferred.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,9 @@ QUnit.test( "jQuery.Deferred.exceptionHook", function( assert ) {
575575
defer=jQuery.Deferred(),
576576
oldWarn=window.console.warn;
577577

578-
window.console.warn=function(){
579-
varmsg=Array.prototype.join.call(arguments," ");
580-
assert.ok(/barf/.test(msg),"Message: "+msg);
578+
window.console.warn=function(_intro,error){
579+
assert.ok(/barf/.test(error.message+"\n"+error.stack),
580+
"Error mentions the method: "+error.message+"\n"+error.stack);
581581
};
582582

583583
jQuery.when(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp