(fn, thisArg)
| 248 | } |
| 249 | |
| 250 | bind(fn, thisArg) { |
| 251 | validateFunction(fn, 'fn'); |
| 252 | let bound; |
| 253 | if (thisArg === undefined) { |
| 254 | const resource = this; |
| 255 | bound = function(...args) { |
| 256 | ArrayPrototypeUnshift(args, fn, this); |
| 257 | return ReflectApply(resource.runInAsyncScope, resource, args); |
| 258 | }; |
| 259 | } else { |
| 260 | bound = FunctionPrototypeBind(this.runInAsyncScope, this, fn, thisArg); |
| 261 | } |
| 262 | ObjectDefineProperties(bound, { |
| 263 | 'length': { |
| 264 | __proto__: null, |
| 265 | configurable: true, |
| 266 | enumerable: false, |
| 267 | value: fn.length, |
| 268 | writable: false, |
| 269 | }, |
| 270 | }); |
| 271 | return bound; |
| 272 | } |
| 273 | |
| 274 | static bind(fn, type, thisArg) { |
| 275 | type ||= fn.name; |
no outgoing calls
no test coverage detected