Loading ...
Sorry, an error occurred while loading the content.

139Re: Modifing Object.prototype kills ajile

Expand Messages
  • iskitzdev
    Jul 4, 2007
    • 0 Attachment
      Well I tested Ajile 0.7.9 with code that modifies Object.prototype and
      it works. It seems to handle external Object.prototype changes without
      problems.

      If you're sure you're seeing the problem with Ajile 0.7.9, please
      prepare a working sample that generates the error. It would also be
      helpful to turn on debugging then send Ajile's log. To turn on debug
      load Ajile with the ?debug as follows:

      <script src="com.iskitz.ajile.0.7.9.js?debug"></script>

      Then add Ajile.ShowLog(); in a script block at the end of your page or
      in your code after all loading has occurred.


      Michael

      --- In ajile@yahoogroups.com, "iskitzdev" <iskitzdev@...> wrote:
      >
      > Hey,
      > Thanks for the feedback. I recognize the error you're talking about
      but
      > it's a bit strange that it's still happening.
      >
      > The code you see traversing Object.prototype is there to defend
      against
      > Object.prototype changes. The associative arrays created and used
      within
      > Ajile can be affected by external changes to Object.prototype, so I
      > intentionally wrote code to distinguish between external changes and
      > what was intended to be there.
      >
      > For some reason it looks like external changes to Object.prototype are
      > still able to pollute Ajile's internal associative arrays so I'll have
      > to spend some time tracking and fixing that. Hopefully it'll be quick,
      > I'll let you know what I find.
      >
      > Thanks for the heads up. Glad you find it useful.
      >
      > -Michael
      >
      > --- In ajile@yahoogroups.com, "fawkyoou" good.midget@ wrote:
      > >
      > > Hey Michael,
      > >
      > > Great work on Ajile. Love it!
      > >
      > > Found what could be considered a bug... When modifying or adding
      > > methods to Object it causes Ajile to throw errors.
      > >
      > > "supporters.getAll is not a function"
      > >
      > > When switching to use com.iskitz.ajile.0.7.9.src.js the error is
      > > triggered @ line 1001. After a cursory inspection, it appears that
      > Ajile
      > > is traversing through [Object].prototype to find members for what
      I'm
      > > assuming is some dependency logic?
      > >
      > > Here's a quick sample of offending code that will cause the error...
      > >
      > > Object.prototype.inherits = function(obj) {
      > > for (var property in obj)
      > > {
      > > this.prototype[property] = obj[property];
      > > }
      > > }
      > >
      > > The following code eliminates the errors but is not a very good
      > > solution. It seems to prevent Ajile from generating short names for
      > > classes on Import (i.e. com.iskitz.ajile becoming simply ajile).
      For
      > me
      > > this is acceptable behavior as I intend to enforce a strict policy
      of
      > > always using the fully qualified namespace when addressing classes.
      > > However, it may be less than ideal for other users.
      > >
      > > Object.prototype.getAll = function () {
      > > try{
      > > return members;
      > > } catch(e) {
      > > return {};
      > > }
      > > };
      > >
      > > I had considered diving a bit deeper into your source, but I feel
      that
      > > it would be more appropriate for you to identify the issue and
      provide
      > a
      > > patched release to the world than to give you some hacked code that
      > may
      > > not be inline with your intentions for Ajile.
      > >
      > > Thanks so much!
      > >
      > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >



      [Non-text portions of this message have been removed]
    • Show all 8 messages in this topic