YUI Connection Manager

               for(var prop in this._http_header){
                       if(this._http_header.propertyIsEnumerable){
                               o.conn.setRequestHeader(prop,
this._http_header[prop]);
                       }
               }

The conditional check will have the effect of filtering out all
browsers which don't support propertyIsEnumerable (effectively
breaking Safari 2).

Regardless, the proposed change to propertyIsEnumerable will have no
effect on the Connection Manager.

There is something called Moodle that seems to use propertyIsEnumerable.

propertyIsEnumerable is a seldom used method.

Have to let implementations know to change support of this feature (if
the change happens).
Flash, all browsers, Apple (konfabulator, OS), Nokia, et c.

The change might even be widely supported until 2012 for a programmer
to use, and then programmers will have to test not for
propertyIsEnumerable, but for which one.


if( "propertyIsEnumerable" in Object.prototype ) {
// Which propertyIsEnumerable do we have?
   if( isPropertyIsEnumearablePrototypeEnabled() ) {
       if( obj.propertyIsEnumerable( prop ) ) {

      }
   }
}

var isPropertyIsEnumearablePrototypeEnabled = function() {
   var o = function(){};
   var garbage = "~~~__0*";
   o.prototype[ garbage ] = true;
   var supported = o.propertyIsEnumerable( garbage );
   return supported;
}

Garrett


On 9/16/07, Bob Clary <[EMAIL PROTECTED]> wrote:
> In a fairly limited scan totaling about 3000 pages of the homepages of
> 33 top sites including those pages linked from the homepages I found
> three occurrences of essentially the same script:
>
> <http://kaden.yahoo.co.jp/js/connection/connection-min.js>
> <http://cn.yimg.com/i/js/ycnconn.js>
> <http://cn.yimg.com/ncp/fashion/js3/ycnconn.js>
>
> where propertyIsEnumerable is used incorrectly (as a property rather
> than as a function) but which appears to have intended to get the "don't
> search prototype" behavior.
>
> Due to the nature of the scan (using the narcissus parser in the
> browser), the scan was fairly slow. I can use a different approach and
> cover more pages if there is more interest. If not, I'll let this rest here.
>
>
> Brendan Eich wrote:
> > On Sep 8, 2007, at 10:06 PM, Garrett Smith wrote:
> >
> >> https://bugzilla.mozilla.org/show_bug.cgi?id=57048
> >>
> >> In this bug, dated 2000, Brendan and David agreed that
> >> isPropertyEnumerable should check the prototype chain.
> >
> > That was a long time ago, and while David Flanagan carries a lot of
> > weight with many folks, he was not on ECMA TC39 TG1, and no one on the
> > group changed the spec.
> >
> > A lot of water under the bridge since then.
> >
> >> It should not backwards compatibility,
> >
> > Famous last words. :-)
> >
> > We try to spider the web (Alexa top 1000 and the like) looking for
> > counterexamples to such claims, and if we fail to find any, or better,
> > we find instances of confusion where the incompatible fix is assumed
> > (i.e., the JS author thought the spec worked the way we want to change
> > it to work), then we have some confidence, but not much more, in favor
> > of making an incompatible change. In general. In this case, no one has
> > done such a scan. I'll see if I can get one started.
> >
> >> but such functionality in the
> >> language seems necessary. How to check enumerable attribute, including
> >> the prototype chain?
> >
> > Either reflect the __proto__ (read-only, please) property as some
> > implementations do, or hardcode the prototype structure and code your
> > propertyIsEnumerable tests accordingly.
> >
> > /be
> >
>
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>


-- 
Programming is a collaborative art.
_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to