fix(forms): use strict runtimeType checks instead of instanceof

Currently, validators extending built-in validators are treated as built-in.
This can result in an error when both a real built-in validator and a custom one are applied to the same element.

Closes #6981
This commit is contained in:
vsavkin
2016-02-09 17:46:38 -08:00
committed by Brian Ford
parent 8f47aa3530
commit 50548fb565
4 changed files with 27 additions and 5 deletions

View File

@ -464,3 +464,7 @@ export function evalExpression(sourceUrl: string, expr: string, declarations: st
export function isPrimitive(obj: any): boolean {
return !isJsObject(obj);
}
export function hasConstructor(value: Object, type: Type): boolean {
return value.constructor === type;
}