- From: youennf <notifications@github.com>
- Date: Mon, 24 Nov 2025 00:56:26 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 24 November 2025 08:56:30 UTC
youennf left a comment (w3c/ServiceWorker#1793)
FWIW, the getter hack short term solution (for newly introduced properties) would be something like:
```
function isNewPropertySupported(propertyName) {
const newPropertyError = new Error('newPropertyError');
const routeWithNewProperty = { };
Object.defineProperty(routeWithNewProperty, propertyName, {
get: function() { throw newPropertyError; }
});
const throwingRoute = {
get urlPattern() { throw new Error('expectedError'); }
};
return installEvent.addRoutes([routeWithNewProperty, throwingRoute]).catch(e => {
return e === newPropertyError;
});
}
```
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1793#issuecomment-3569601593
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/issues/1793/3569601593@github.com>
Received on Monday, 24 November 2025 08:56:30 UTC