Repository: google/closure-compiler (language: java)

Issue:
Is it a bug that the extern for AbortController doesn't allow a reason argument?
I tried [asking this on SO](https://stackoverflow.com/questions/74445883/can-i-update-the-extern-for-abortcontroller-in-the-google-closure-compiler) but didn't get any replies. It appears to me that a "reason" argument is allowed in the browser when calling `abort()` on a Fetch `AbortController`, but the externs built into Closure don't allow it.

Any fixes or workarounds?


Discussion / hints:

Fix patch:
diff --git a/externs/browser/w3c_abort.js b/externs/browser/w3c_abort.js
index e5362dd72c8..c8f7565853c 100644
--- a/externs/browser/w3c_abort.js
+++ b/externs/browser/w3c_abort.js
@@ -29,12 +29,29 @@
  */
 function AbortSignal() {}
 
-/** @type {boolean} */
+/** @const {boolean} */
 AbortSignal.prototype.aborted;
 
 /** @type {?function(!Event)} */
 AbortSignal.prototype.onabort;
 
+/** @const {?} */
+AbortSignal.prototype.reason;
+
+/** @return {void} */
+AbortSignal.prototype.throwIfAborted = function() {};
+
+/**
+ * @param {?=} reason
+ * @return {AbortSignal}
+ */
+AbortSignal.abort = function (reason) {};
+
+/**
+ * @param {number} time
+ * @return {AbortSignal}
+ */
+AbortSignal.timeout = function(time) {};
 
 
 /**
@@ -46,5 +63,8 @@ function AbortController() {}
 /** @const {!AbortSignal} */
 AbortController.prototype.signal;
 
-/** @return {void} */
-AbortController.prototype.abort = function() {};
+/**
+ * @param {?=} reason
+ * @return {void}
+ */
+AbortController.prototype.abort = function(reason) {};


Test patch: