-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing issue where if a throw occurred in a promise without any attac…
…hed rejection handlers, we wouldn't notify the debugger that an unhandled exception occurred
- Loading branch information
Mike Kaufman
committed
Jun 26, 2018
1 parent
756ee73
commit e97affd
Showing
19 changed files
with
707 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Error: throw exception from throwFunction | ||
at throwFunction() (JsDiagBreakOnUncaughtException.js:18:4) | ||
at Global code (JsDiagBreakOnUncaughtException.js:20:1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
/**exception(uncaught):stack();**/ | ||
|
||
function noThrowFunction() { | ||
try { | ||
throw new Error("throw exception from noThrowFunction"); | ||
} catch (err) { | ||
} | ||
} | ||
noThrowFunction(); | ||
|
||
// calling throwFunction() will terminate program, so this has to come last | ||
function throwFunction() { | ||
throw new Error("throw exception from throwFunction"); | ||
} | ||
throwFunction(); |
18 changes: 18 additions & 0 deletions
18
test/Debugger/JsDiagBreakOnUncaughtException.js.dbg.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"callStack": [ | ||
{ | ||
"line": 17, | ||
"column": 3, | ||
"sourceText": "throw new Error(\"throw exception from throwFunction\")", | ||
"function": "throwFunction" | ||
}, | ||
{ | ||
"line": 19, | ||
"column": 0, | ||
"sourceText": "throwFunction()", | ||
"function": "Global code" | ||
} | ||
] | ||
} | ||
] |
Empty file.
35 changes: 35 additions & 0 deletions
35
test/Debugger/JsDiagExceptionsInAsyncFunctions_BreakOnUncaughtExceptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
/**exception(uncaught):stack();**/ | ||
|
||
async function f1() { | ||
await null; | ||
throw new Error('error in f1'); | ||
} | ||
f1(); | ||
|
||
async function f2() { | ||
|
||
async function f2a() { | ||
throw "err"; | ||
} | ||
|
||
async function f2b() { | ||
try { | ||
var p = f2a(); | ||
} catch (e) { | ||
console.log("caught " + e); | ||
} | ||
} | ||
|
||
async function f2c() { | ||
var p = f2a(); | ||
} | ||
|
||
f2b(); | ||
f2c(); | ||
} | ||
f2(); |
40 changes: 40 additions & 0 deletions
40
test/Debugger/JsDiagExceptionsInAsyncFunctions_BreakOnUncaughtExceptions.js.dbg.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
{ | ||
"callStack": [ | ||
{ | ||
"line": 16, | ||
"column": 8, | ||
"sourceText": "throw \"err\"", | ||
"function": "f2a" | ||
}, | ||
{ | ||
"line": 28, | ||
"column": 8, | ||
"sourceText": "var p = f2a()", | ||
"function": "f2c" | ||
}, | ||
{ | ||
"line": 32, | ||
"column": 4, | ||
"sourceText": "f2c()", | ||
"function": "f2" | ||
}, | ||
{ | ||
"line": 34, | ||
"column": 0, | ||
"sourceText": "f2()", | ||
"function": "Global code" | ||
} | ||
] | ||
}, | ||
{ | ||
"callStack": [ | ||
{ | ||
"line": 9, | ||
"column": 4, | ||
"sourceText": "throw new Error('error in f1')", | ||
"function": "f1" | ||
} | ||
] | ||
} | ||
] |
Empty file.
20 changes: 20 additions & 0 deletions
20
test/Debugger/JsDiagExceptionsInPromises_BreakOnFirstChanceExceptions.crosscontext.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
var externalContextPromise = (function () { | ||
let resolvePromise; | ||
let promise = new Promise((resolve, reject) => { | ||
resolvePromise = resolve; | ||
|
||
}); | ||
promise = promise.then(()=> { | ||
throw new Error("error from externalContextPromise1"); | ||
}) | ||
|
||
return { | ||
promise, | ||
resolvePromise | ||
}; | ||
})(); |
Oops, something went wrong.