This PR ensures that we always use the Error class explicitly from the global object instead of the "ambient" Error class. The reason is that users (or as reported frameworks) are free to name their own classes "Error" in which case the file injection would instantiate the user-created and not the global class.
This PR ensures that we always use the
Error
class explicitly from the global object instead of the "ambient"Error
class. The reason is that users (or as reported frameworks) are free to name their own classes "Error" in which case the file injection would instantiate the user-created and not the global class.Ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/593