Skip to content

Commit

Permalink
Load exception event
Browse files Browse the repository at this point in the history
Dispatch load exception so that others can react without capturing the corresponding error. Will be used in conjunction with dart-lang/test#682

Bug:
Change-Id: I19458ac01ba013cac6ad5408b3b763777e50ca4e
Reviewed-on: https://dart-review.googlesource.com/6644
Reviewed-by: Jake Macdonald <[email protected]>
Commit-Queue: Gary Roumanis <[email protected]>
  • Loading branch information
grouma authored and [email protected] committed Sep 18, 2017
1 parent 89b700e commit 07e9cfe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/dev_compiler/lib/js/legacy/dart_library.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ dart_library =

/** Note that we cannot use dart_utils.throwInternalError from here. */
function throwLibraryError(message) {
// Dispatch event to allow others to react to the load error without
// capturing the exception.
var errorEvent = new CustomEvent('dartLoadException', { detail: message });
window.dispatchEvent(errorEvent);
throw Error(message);
}

Expand Down

0 comments on commit 07e9cfe

Please sign in to comment.