Skip to content

Commit 8fffbb8

Browse files
author
Jeremy Bornstein
committed
Add interface type-checking for timeSource config in RequestDelay.
Use MustBe.instanceOf() to validate that non-null timeSource values implement IntfTimeSource, matching the pattern used in TokenBucket.
1 parent 1cf237f commit 8fffbb8

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/webapp-builtins/export/RequestDelay.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,9 @@ export class RequestDelay extends BaseApplication {
101101
* @returns {IntfTimeSource} Accepted configuration value.
102102
*/
103103
_config_timeSource(value = null) {
104-
// TODO: Check that a non-`null` `value` actually implements
105-
// `IntfTimeSource`.
106-
107104
return (value === null)
108105
? StdTimeSource.INSTANCE
109-
: MustBe.object(value);
106+
: MustBe.instanceOf(value, IntfTimeSource);
110107
}
111108

112109
/** @override */

0 commit comments

Comments
 (0)