From da4eda535893f1a26b095e5890658099e89d9457 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 6 Mar 2023 10:27:40 -0400 Subject: data-steps: initial commit --- src/util/sugar.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/util/sugar.js') diff --git a/src/util/sugar.js b/src/util/sugar.js index 0813c1d4..c60bddb6 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -150,6 +150,15 @@ export function bindOpts(fn, bind) { value: fn.name ? `(options-bound) ${fn.name}` : `(options-bound)`, }); + for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(fn))) { + if (key === 'length') continue; + if (key === 'name') continue; + if (key === 'arguments') continue; + if (key === 'caller') continue; + if (key === 'prototype') continue; + Object.defineProperty(bound, key, descriptor); + } + return bound; } -- cgit 1.3.0-6-gf8a5