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

Re: Modifing Object.prototype kills ajile

Expand Messages
  • iskitzdev
    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
    Message 1 of 8 , Jul 3, 2007
    • 0 Attachment
      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]
    • iskitzdev
      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
      Message 2 of 8 , 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]
      • fawkyoou
        Hey Michael, I ve been doing some digging, and it appears that this Object.prototype problem may, in fact, be the cause of the Import issues and some other
        Message 3 of 8 , Jul 13, 2007
        • 0 Attachment
          Hey Michael,

          I've been doing some digging, and it appears that this
          Object.prototype problem may, in fact, be the cause of the Import
          issues and some other event firing issues that I've noticed.

          Here's what seems to be happening... Somehow the Object.prototype
          properties are getting into the members pool of SimpleSet... As
          handleImportLoaded runs it checks in with isSupported. isSupported
          calls dependence.get() (Another instance of SimpleSet) which is, in
          some cases returning a reference to one of the prototypes of Object.
          Obviously .getAll has not been assigned to that prototype which is
          throwing out the error. By adding getAll to Object.prototype it
          eliminates this error, but fails at the subsequent GetModule() call -
          for obvious reasons (it's not actually one the dependencies it's just
          a member of Object.prototype)... This of course cancels the remaining
          execution of handleImportLoaded causing the event not to fire.

          It's a bit of a hack and you may want to do this checking elsewhere,
          but modifying line 1001 & 1005 solves the problem and eliminates the
          need for my workaround hack previously posted.

          Line 1001 read: if(!supporters || !(supporters = supporters.getAll()))
          Now reads: if (!supporters || (!(supporters in Object.prototype) &&
          (supporters.getAll) && !(supporters = supporters.getAll())))

          Added to line 1005 - befre if(!GetModule...

          if(!(supporter in Object.prototype))


          This fix solves BOTH issues I was experiencing...


          --- In ajile@yahoogroups.com, "iskitzdev" <iskitzdev@...> wrote:
          >
          > 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]
          >
        • mikeizworkin
          Excellent! This is precisely the change I mentioned vaguely in my response to your last post. Great work. I ll be making a new release soon, it will include
          Message 4 of 8 , Jul 13, 2007
          • 0 Attachment
            Excellent!

            This is precisely the change I mentioned vaguely in my response to your
            last post.

            Great work. I'll be making a new release soon, it will include this as
            well as a few other changes. I'm not sure what else I'll try to squeeze
            in, but since you've already worked it out, maybe I'll be less rushed,
            we'll see.

            Would you by chance be at all interested in helping me create unit
            tests? I'm using the jsUnit framework and have a base set, but it takes
            effort and I may not be able to think of all possibilities on my own...

            --- In ajile@yahoogroups.com, "fawkyoou" <good.midget@...> wrote:
            >
            > Hey Michael,
            >
            > I've been doing some digging, and it appears that this
            > Object.prototype problem may, in fact, be the cause of the Import
            > issues and some other event firing issues that I've noticed.
            >
            > Here's what seems to be happening... Somehow the Object.prototype
            > properties are getting into the members pool of SimpleSet... As
            > handleImportLoaded runs it checks in with isSupported. isSupported
            > calls dependence.get() (Another instance of SimpleSet) which is, in
            > some cases returning a reference to one of the prototypes of Object.
            > Obviously .getAll has not been assigned to that prototype which is
            > throwing out the error. By adding getAll to Object.prototype it
            > eliminates this error, but fails at the subsequent GetModule() call -
            > for obvious reasons (it's not actually one the dependencies it's just
            > a member of Object.prototype)... This of course cancels the remaining
            > execution of handleImportLoaded causing the event not to fire.
            >
            > It's a bit of a hack and you may want to do this checking elsewhere,
            > but modifying line 1001 & 1005 solves the problem and eliminates the
            > need for my workaround hack previously posted.
            >
            > Line 1001 read: if(!supporters || !(supporters = supporters.getAll()))
            > Now reads: if (!supporters || (!(supporters in Object.prototype) &&
            > (supporters.getAll) && !(supporters = supporters.getAll())))
            >
            > Added to line 1005 - befre if(!GetModule...
            >
            > if(!(supporter in Object.prototype))
            >
            >
            > This fix solves BOTH issues I was experiencing...
            >
            >
            > --- In ajile@yahoogroups.com, "iskitzdev" iskitzdev@ wrote:
            > >
            > > 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]
            > >
            >
          • fawkyoou
            Sweet! I d love to help you out with setting up your unit tests. At the moment I m pretty slammed with building out our architecture for another project.
            Message 5 of 8 , Jul 13, 2007
            • 0 Attachment
              Sweet!

              I'd love to help you out with setting up your unit tests. At the
              moment I'm pretty slammed with building out our architecture for
              another project. However, part of that will be extensive unit tests
              also based on JSUnit. Part of unit testing I have planned for that
              already includes writing some tests for ajile, in part to make sure
              that if we upgrade to your next release we don't break our builds.
              May be a couple weeks before we're there, but I'll certainly make sure
              that you get any of those tests, and if you can think of additional
              areas you'd like tested I can work that into our cycles.

              Are you available on any instant messenger protocols? Perhaps that
              will help our communication...

              _Danny

              --- In ajile@yahoogroups.com, "mikeizworkin" <mikeizworkin@...> wrote:
              >
              > Excellent!
              >
              > This is precisely the change I mentioned vaguely in my response to your
              > last post.
              >
              > Great work. I'll be making a new release soon, it will include this as
              > well as a few other changes. I'm not sure what else I'll try to squeeze
              > in, but since you've already worked it out, maybe I'll be less rushed,
              > we'll see.
              >
              > Would you by chance be at all interested in helping me create unit
              > tests? I'm using the jsUnit framework and have a base set, but it takes
              > effort and I may not be able to think of all possibilities on my own...
              >
              > --- In ajile@yahoogroups.com, "fawkyoou" <good.midget@> wrote:
              > >
              > > Hey Michael,
              > >
              > > I've been doing some digging, and it appears that this
              > > Object.prototype problem may, in fact, be the cause of the Import
              > > issues and some other event firing issues that I've noticed.
              > >
              > > Here's what seems to be happening... Somehow the Object.prototype
              > > properties are getting into the members pool of SimpleSet... As
              > > handleImportLoaded runs it checks in with isSupported. isSupported
              > > calls dependence.get() (Another instance of SimpleSet) which is, in
              > > some cases returning a reference to one of the prototypes of Object.
              > > Obviously .getAll has not been assigned to that prototype which is
              > > throwing out the error. By adding getAll to Object.prototype it
              > > eliminates this error, but fails at the subsequent GetModule() call -
              > > for obvious reasons (it's not actually one the dependencies it's just
              > > a member of Object.prototype)... This of course cancels the remaining
              > > execution of handleImportLoaded causing the event not to fire.
              > >
              > > It's a bit of a hack and you may want to do this checking elsewhere,
              > > but modifying line 1001 & 1005 solves the problem and eliminates the
              > > need for my workaround hack previously posted.
              > >
              > > Line 1001 read: if(!supporters || !(supporters = supporters.getAll()))
              > > Now reads: if (!supporters || (!(supporters in Object.prototype) &&
              > > (supporters.getAll) && !(supporters = supporters.getAll())))
              > >
              > > Added to line 1005 - befre if(!GetModule...
              > >
              > > if(!(supporter in Object.prototype))
              > >
              > >
              > > This fix solves BOTH issues I was experiencing...
              > >
              > >
              > > --- In ajile@yahoogroups.com, "iskitzdev" iskitzdev@ wrote:
              > > >
              > > > 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]
              > > >
              > >
              >
            • iskitzdev
              Danny, Thanks for the offer. Yeah I d appreciate those tests, makes my life easier too. I use Ajile in some of my own projects and being able to rely on it
              Message 6 of 8 , Jul 13, 2007
              • 0 Attachment
                Danny,
                Thanks for the offer. Yeah I'd appreciate those tests, makes my life
                easier too.

                I use Ajile in some of my own projects and being able to rely on it
                working really helps tracking the real issues, rather than symptoms.

                The next release will have complete backwards compatibility for older
                versions, configurable with the legacy load time option or at runtime
                with the corresponding enabler method. So breaking your code will be
                less-likely, at least from a deprecated API standpoint.

                I'll let you know about the pending release.

                --- In ajile@yahoogroups.com, "fawkyoou" <good.midget@...> wrote:
                >
                > Sweet!
                >
                > I'd love to help you out with setting up your unit tests. At the
                > moment I'm pretty slammed with building out our architecture for
                > another project. However, part of that will be extensive unit tests
                > also based on JSUnit. Part of unit testing I have planned for that
                > already includes writing some tests for ajile, in part to make sure
                > that if we upgrade to your next release we don't break our builds.
                > May be a couple weeks before we're there, but I'll certainly make sure
                > that you get any of those tests, and if you can think of additional
                > areas you'd like tested I can work that into our cycles.
                >
                > Are you available on any instant messenger protocols? Perhaps that
                > will help our communication...
                >
                > _Danny
                >
                > --- In ajile@yahoogroups.com, "mikeizworkin" mikeizworkin@ wrote:
                > >
                > > Excellent!
                > >
                > > This is precisely the change I mentioned vaguely in my response to
                your
                > > last post.
                > >
                > > Great work. I'll be making a new release soon, it will include
                this as
                > > well as a few other changes. I'm not sure what else I'll try to
                squeeze
                > > in, but since you've already worked it out, maybe I'll be less
                rushed,
                > > we'll see.
                > >
                > > Would you by chance be at all interested in helping me create unit
                > > tests? I'm using the jsUnit framework and have a base set, but it
                takes
                > > effort and I may not be able to think of all possibilities on my
                own...
                > >
                > > --- In ajile@yahoogroups.com, "fawkyoou" <good.midget@> wrote:
                > > >
                > > > Hey Michael,
                > > >
                > > > I've been doing some digging, and it appears that this
                > > > Object.prototype problem may, in fact, be the cause of the Import
                > > > issues and some other event firing issues that I've noticed.
                > > >
                > > > Here's what seems to be happening... Somehow the Object.prototype
                > > > properties are getting into the members pool of SimpleSet... As
                > > > handleImportLoaded runs it checks in with isSupported. isSupported
                > > > calls dependence.get() (Another instance of SimpleSet) which is,
                in
                > > > some cases returning a reference to one of the prototypes of
                Object.
                > > > Obviously .getAll has not been assigned to that prototype which is
                > > > throwing out the error. By adding getAll to Object.prototype it
                > > > eliminates this error, but fails at the subsequent GetModule()
                call -
                > > > for obvious reasons (it's not actually one the dependencies it's
                just
                > > > a member of Object.prototype)... This of course cancels the
                remaining
                > > > execution of handleImportLoaded causing the event not to fire.
                > > >
                > > > It's a bit of a hack and you may want to do this checking
                elsewhere,
                > > > but modifying line 1001 & 1005 solves the problem and eliminates
                the
                > > > need for my workaround hack previously posted.
                > > >
                > > > Line 1001 read: if(!supporters || !(supporters =
                supporters.getAll()))
                > > > Now reads: if (!supporters || (!(supporters in Object.prototype)
                &&
                > > > (supporters.getAll) && !(supporters = supporters.getAll())))
                > > >
                > > > Added to line 1005 - befre if(!GetModule...
                > > >
                > > > if(!(supporter in Object.prototype))
                > > >
                > > >
                > > > This fix solves BOTH issues I was experiencing...
                > > >
                > > >
                > > > --- In ajile@yahoogroups.com, "iskitzdev" iskitzdev@ wrote:
                > > > >
                > > > > 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]
                > > > >
                > > >
                > >
                >
              • iskitzdev
                Update! This sneaky bug occurs in one more place, it s like a virus I tell you! This has got to be one of the best examples of how much trouble, pain, and time
                Message 7 of 8 , Jul 13, 2007
                • 0 Attachment
                  Update!

                  This sneaky bug occurs in one more place, it's like a virus I tell you!

                  This has got to be one of the best examples of how much trouble, pain,
                  and time is caused and spent when Object.prototype is modified. It's
                  great that JavaScript is flexible enough to allow handling and coding
                  around things like this.

                  Beautiful, Ajile lives again :-)

                  Until I release the next version, those experiencing the symptoms
                  discussed in this thread should patch the updateDependents(fullName)
                  function by replacing its for loop with the following:

                  for(var user in users)
                  /*===>*/ if(!(user in Object.prototype)) /*<===*/
                  if(pendingImports.has(user) && (module = GetModule(user)))
                  if(handleImportLoaded(pendingImports.get(user), user,
                  module, this))
                  updateDependents(user);

                  Happy importing people! --- Yes its late and I should probably be
                  sleeping, lucky for you I'm not :-)

                  -Michael


                  --- In ajile@yahoogroups.com, "iskitzdev" <iskitzdev@...> wrote:
                  >
                  > Danny,
                  > Thanks for the offer. Yeah I'd appreciate those tests, makes my life
                  > easier too.
                  >
                  > I use Ajile in some of my own projects and being able to rely on it
                  > working really helps tracking the real issues, rather than symptoms.
                  >
                  > The next release will have complete backwards compatibility for older
                  > versions, configurable with the legacy load time option or at runtime
                  > with the corresponding enabler method. So breaking your code will be
                  > less-likely, at least from a deprecated API standpoint.
                  >
                  > I'll let you know about the pending release.
                  >
                  > --- In ajile@yahoogroups.com, "fawkyoou" good.midget@ wrote:
                  > >
                  > > Sweet!
                  > >
                  > > I'd love to help you out with setting up your unit tests. At the
                  > > moment I'm pretty slammed with building out our architecture for
                  > > another project. However, part of that will be extensive unit tests
                  > > also based on JSUnit. Part of unit testing I have planned for that
                  > > already includes writing some tests for ajile, in part to make sure
                  > > that if we upgrade to your next release we don't break our builds.
                  > > May be a couple weeks before we're there, but I'll certainly make
                  sure
                  > > that you get any of those tests, and if you can think of additional
                  > > areas you'd like tested I can work that into our cycles.
                  > >
                  > > Are you available on any instant messenger protocols? Perhaps that
                  > > will help our communication...
                  > >
                  > > _Danny
                  > >
                  > > --- In ajile@yahoogroups.com, "mikeizworkin" mikeizworkin@ wrote:
                  > > >
                  > > > Excellent!
                  > > >
                  > > > This is precisely the change I mentioned vaguely in my response to
                  > your
                  > > > last post.
                  > > >
                  > > > Great work. I'll be making a new release soon, it will include
                  > this as
                  > > > well as a few other changes. I'm not sure what else I'll try to
                  > squeeze
                  > > > in, but since you've already worked it out, maybe I'll be less
                  > rushed,
                  > > > we'll see.
                  > > >
                  > > > Would you by chance be at all interested in helping me create unit
                  > > > tests? I'm using the jsUnit framework and have a base set, but it
                  > takes
                  > > > effort and I may not be able to think of all possibilities on my
                  > own...
                  > > >
                  > > > --- In ajile@yahoogroups.com, "fawkyoou" <good.midget@> wrote:
                  > > > >
                  > > > > Hey Michael,
                  > > > >
                  > > > > I've been doing some digging, and it appears that this
                  > > > > Object.prototype problem may, in fact, be the cause of the
                  Import
                  > > > > issues and some other event firing issues that I've noticed.
                  > > > >
                  > > > > Here's what seems to be happening... Somehow the
                  Object.prototype
                  > > > > properties are getting into the members pool of SimpleSet... As
                  > > > > handleImportLoaded runs it checks in with isSupported.
                  isSupported
                  > > > > calls dependence.get() (Another instance of SimpleSet) which is,
                  > in
                  > > > > some cases returning a reference to one of the prototypes of
                  > Object.
                  > > > > Obviously .getAll has not been assigned to that prototype which
                  is
                  > > > > throwing out the error. By adding getAll to Object.prototype it
                  > > > > eliminates this error, but fails at the subsequent GetModule()
                  > call -
                  > > > > for obvious reasons (it's not actually one the dependencies it's
                  > just
                  > > > > a member of Object.prototype)... This of course cancels the
                  > remaining
                  > > > > execution of handleImportLoaded causing the event not to fire.
                  > > > >
                  > > > > It's a bit of a hack and you may want to do this checking
                  > elsewhere,
                  > > > > but modifying line 1001 & 1005 solves the problem and eliminates
                  > the
                  > > > > need for my workaround hack previously posted.
                  > > > >
                  > > > > Line 1001 read: if(!supporters || !(supporters =
                  > supporters.getAll()))
                  > > > > Now reads: if (!supporters || (!(supporters in Object.prototype)
                  > &&
                  > > > > (supporters.getAll) && !(supporters = supporters.getAll())))
                  > > > >
                  > > > > Added to line 1005 - befre if(!GetModule...
                  > > > >
                  > > > > if(!(supporter in Object.prototype))
                  > > > >
                  > > > >
                  > > > > This fix solves BOTH issues I was experiencing...
                  > > > >
                  > > > >
                  > > > > --- In ajile@yahoogroups.com, "iskitzdev" iskitzdev@ wrote:
                  > > > > >
                  > > > > > 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]
                  > > > > >
                  > > > >
                  > > >
                  > >
                  >



                  [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.