Be resilient to fn.name not existing in IE

Fixes #516.
This commit is contained in:
Ben Alpert
2013-11-24 01:53:53 -05:00
parent d51ae6b8bc
commit 685dec022a
+4 -3
View File
@@ -124,18 +124,19 @@ describe('Instance Types', function() {
it("should throw for invalid instances", function() {
function Person() {}
var name = Person.name || '<<anonymous>>';
expect(typeCheck(Props.instanceOf(Person), false)).toThrow(
'Invariant Violation: Invalid prop `testProp` supplied to ' +
'`testComponent`, expected instance of `Person`.'
'`testComponent`, expected instance of `' + name + '`.'
);
expect(typeCheck(Props.instanceOf(Person), {})).toThrow(
'Invariant Violation: Invalid prop `testProp` supplied to ' +
'`testComponent`, expected instance of `Person`.'
'`testComponent`, expected instance of `' + name + '`.'
);
expect(typeCheck(Props.instanceOf(Person), '')).toThrow(
'Invariant Violation: Invalid prop `testProp` supplied to ' +
'`testComponent`, expected instance of `Person`.'
'`testComponent`, expected instance of `' + name + '`.'
);
});