Explorar el Código

Added a comment for the feature detector.

Maciej Bukowski hace 6 años
padre
commit
3ff2d62857
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      packages/ckeditor5-watchdog/tests/watchdog.js

+ 2 - 0
packages/ckeditor5-watchdog/tests/watchdog.js

@@ -918,6 +918,8 @@ function throwCKEditorError( name, context ) {
 	throw new CKEditorError( name, context );
 	throw new CKEditorError( name, context );
 }
 }
 
 
+// Feature detection works as a race condition - if the `unhandledrejection` event
+// is supported then the listener should be called first. Otherwise the timeout will be reached.
 function doesEnvSupportUnhandledRejectionEvent() {
 function doesEnvSupportUnhandledRejectionEvent() {
 	return new Promise( res => {
 	return new Promise( res => {
 		window.addEventListener( 'unhandledrejection', function listener() {
 		window.addEventListener( 'unhandledrejection', function listener() {