Use Object.getPrototypeOf instead of obj.__proto__

This commit is contained in:
Jerko Steiner 2019-08-30 13:19:04 +07:00
parent 05946ee342
commit 4ea534293b

View File

@ -60,7 +60,7 @@ function ensureMethod<Context>(
export function getValidatorsForInstance<Context>( export function getValidatorsForInstance<Context>(
target: any, target: any,
): Array<Validate<Context>> { ): Array<Validate<Context>> {
return getValidatorsForClass(target.__proto__.constructor) return getValidatorsForClass(Object.getPrototypeOf(target).constructor)
} }
export function getValidatorsForClass<Context>( export function getValidatorsForClass<Context>(