mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-16 10:39:53 +00:00
Make @bind the same as Surma's implementation
This commit is contained in:
@@ -39,11 +39,11 @@ export function bind(target: any, propertyKey: string, descriptor: PropertyDescr
|
|||||||
// define an instance property pointing to the bound function.
|
// define an instance property pointing to the bound function.
|
||||||
// This effectively "caches" the bound prototype method as an instance property.
|
// This effectively "caches" the bound prototype method as an instance property.
|
||||||
get() {
|
get() {
|
||||||
let boundFunction = descriptor.value.bind(this);
|
let bound = descriptor.value.bind(this);
|
||||||
Object.defineProperty(this, propertyKey, {
|
Object.defineProperty(this, propertyKey, {
|
||||||
value: boundFunction
|
value: bound
|
||||||
});
|
});
|
||||||
return boundFunction;
|
return bound;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user