use register for degradeBy / undegradeBy
This commit is contained in:
parent
4340f024d3
commit
09b15a07c6
3 changed files with 11 additions and 22 deletions
|
|
@ -1277,9 +1277,9 @@ export function register(name, func) {
|
|||
args = args.map(reify);
|
||||
// For methods that take a single argument (plus 'this'), allow
|
||||
// multiple arguments but sequence them
|
||||
if (arity == 2 && args.length != 1) {
|
||||
if (arity === 2 && args.length !== 1) {
|
||||
args = [sequence(...args)];
|
||||
} else if (arity != args.length + 1) {
|
||||
} else if (arity !== args.length + 1) {
|
||||
throw new Error(`.${name}() expects ${arity - 1} inputs but got ${args.length}.`);
|
||||
}
|
||||
return pfunc(...args, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue