mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(platform-browser): drop unsupported event target error message in production (#60016)
Drops unsupported event target error message in production and replaces it with an existing error code. PR Close #60016
This commit is contained in:
parent
5c70a048a9
commit
a8ec7bebf2
1 changed files with 6 additions and 2 deletions
|
|
@ -419,13 +419,17 @@ class DefaultDomRenderer2 implements Renderer2 {
|
|||
if (typeof target === 'string') {
|
||||
target = getDOM().getGlobalEventTarget(this.doc, target);
|
||||
if (!target) {
|
||||
throw new Error(`Unsupported event target ${target} for event ${event}`);
|
||||
throw new RuntimeError(
|
||||
RuntimeErrorCode.UNSUPPORTED_EVENT_TARGET,
|
||||
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
||||
`Unsupported event target ${target} for event ${event}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let wrappedCallback = this.decoratePreventDefault(callback);
|
||||
|
||||
if (this.tracingService !== null && this.tracingService.wrapEventListener) {
|
||||
if (this.tracingService?.wrapEventListener) {
|
||||
wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue