You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than using try/catch to detect when `document` is missing we
explicitly check for it. This is the same pattern used in the other
version of `findEventTarget` on line 336.
This avoids casting a wide net and hiding errors in the rest of the code
in this function. Its also more consistent with the other version of
`findEventTarget`.
// Find a DOM element with the given ID, or null if none is found.
379
380
$findEventTarget__deps: ['$specialHTMLTargets'],
380
381
$findEventTarget: (target)=>{
381
382
#if ASSERTIONS
382
383
warnOnce('Rules for selecting event targets in HTML5 API are changing: instead of using document.getElementById() that only can refer to elements by their DOM ID, new event target selection mechanism uses the more flexible function document.querySelector() that can look up element names, classes, and complex CSS selectors. Build with -sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR to change to the new lookup rules. See https://github.com/emscripten-core/emscripten/pull/7977 for more details.');
383
384
#endif
384
-
try{
385
-
// The sensible "default" target varies between events, but use window as the default
386
-
// since DOM events mostly can default to that. Specific callback registrations
0 commit comments