Reviewers: MarkM,
Description:
In testbed.js:
if (!name && ('name' in ctor) && !___.hasOwnProp(ctor, 'name'))
{
name = ctor.name;
}
appears in a context where ctor is a genuine constructor function. This
will only be true when Function.prototype has a 'name' property (as it
does
at least on FF, where it is the empty string) and ctor does not override
it
with its own 'name' property. I suspect you meant not to "!" the
hasOwnProp
test.
Please review this at http://codereview.appspot.com/12509
Affected files:
M src/com/google/caja/opensocial/applet/testbed.js
Index: src/com/google/caja/opensocial/applet/testbed.js
===================================================================
--- src/com/google/caja/opensocial/applet/testbed.js (revision 3201)
+++ src/com/google/caja/opensocial/applet/testbed.js (working copy)
@@ -323,7 +323,7 @@
var name;
if (ctor) {
name = ctor.NAME___;
- if (!name && ('name' in ctor) && !___.hasOwnProp(ctor, 'name')) {
+ if (!name && ('name' in ctor) && ___.hasOwnProp(ctor, 'name')) {
name = ctor.name;
}
if (name) { return String(name); }