Skip to content

Commit d3e59b3

Browse files
committed
Fix defineProperty type casting issue causing test failures
1 parent b33842a commit d3e59b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

injected/src/content-feature.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export default class ContentFeature extends ConfigFeature {
281281
}
282282
});
283283

284-
return defineProperty(object, String(propertyName), /** @type {any} */ (descriptor));
284+
return defineProperty(object, propertyName, /** @type {import('./wrapper-utils').StrictPropertyDescriptor} */ (descriptor));
285285
}
286286

287287
/**

injected/src/wrapper-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const ddgShimMark = Symbol('ddgShimMark');
1414
* FIXME: this function is not needed anymore after FF xray removal
1515
* Like Object.defineProperty, but with support for Firefox's mozProxies.
1616
* @param {any} object - object whose property we are wrapping (most commonly a prototype, e.g. globalThis.BatteryManager.prototype)
17-
* @param {string} propertyName
17+
* @param {string | number | symbol} propertyName
1818
* @param {import('./wrapper-utils').StrictPropertyDescriptor} descriptor - requires all descriptor options to be defined because we can't validate correctness based on TS types
1919
*/
2020
export function defineProperty(object, propertyName, descriptor) {

0 commit comments

Comments
 (0)