#37 ✓invalid
Jonathan Dunn

"cache has no properies"

Reported by Jonathan Dunn | April 22nd, 2008 @ 04:24 PM

Hello,

The above error appears to occur using Firefox 1.0.6 and 1.0.7 (may be more - only tested these) at this line.

if (!cache[tagName]) cache[tagName] =

Element.extend(document.createElement(tagName));

Regards,

Jonathan.

Comments and changes to this ticket

  • Juriy Zaytsev

    Juriy Zaytsev April 22nd, 2008 @ 05:42 PM

    Which version of prototype? When exactly does this happen - by simply including prototype or by actually calling something?

  • Jonathan Dunn

    Jonathan Dunn April 22nd, 2008 @ 08:14 PM

    Hi there,

    Prototype 1.6.0.2 - unsure which part of my code is calling that code because I am using a third party library, prototip. Seems not to effect any other prototype related features on the page though when the error is produced.

    Sorry i'm unable to give more info! If you need the url to an example page then feel free to email me.

    Regards,

    Jonathan.

  • John-David Dalton

    John-David Dalton April 22nd, 2008 @ 08:21 PM

    • State changed from “new” to “invalid”

    Those version are not supported by Prototype:

    http://www.prototypejs.org/download

  • Nick Stakenburg

    Nick Stakenburg April 22nd, 2008 @ 08:35 PM

    I'm not testing on Firefox 1.0.6 with Prototip. Prototype doesn't support that browser anymore, see the readme

    But feel free to drop me an email with a failing example.

    This ticket can probably be closed, I'll reopen should I find something.

  • chris.kreager@gmail.com

    chris.kreager@gmail.com April 24th, 2008 @ 08:52 PM

    In Mozilla 1.7.13, Gecko, the error "cache has no properties" can be fixed with the attached patch file.

    Error: cache has no properties

    Source File: https://rva-ckreager/javascripts...

    Line: 1571

  • John-David Dalton

    John-David Dalton April 24th, 2008 @ 08:57 PM

    I can't see the source file (invalid url)

  • chris.kreager@gmail.com

    chris.kreager@gmail.com April 24th, 2008 @ 09:19 PM

    I should have stated in my previous post that I was using Prototype 1.6.0 when I discovered the bug. I then updated to 1.6.0.2 and noticed the change where it now includes the line

    var cache = Element.cache;

    After some testing in Mozilla I was able to conclude that Element is unknown and by testing for Gecko I could create an empty function instead of Element. Another solution could be to test if Element is unknown.

    This is my first post, I apologize if the patch file should have been submitted somewhere else.

    -----

    "I can't see the source file (invalid url)"

    I copied the error text from Mozilla's JavaScript Console which includes the url of our internal web server. The source is the Prototype 1.6.0.2 file downloadable here: http://www.prototypejs.org/asset...

    The patch is just a one line change that I attached in the previous post.

  • Juriy Zaytsev

    Juriy Zaytsev April 25th, 2008 @ 03:43 AM

    Chris,

    your patch essentially does the same thing as what prototype does - creates an empty object (though via an empty constructor). Since instantiating new object internally calls "new Object()", I think calling "new Object()" instead of using object literal "{}" should work as well.

    Could you please check if that fixes the issue?

    Thanks.

  • John-David Dalton

    John-David Dalton April 25th, 2008 @ 04:42 AM

    Maybe I am missing the point, but if the browser, which is not supported, has trouble using the Event object which is defined :

    if (!window.Event) var Event = { };
    

    then the cache object added via:

    object.extend(Event, {
      ...
      cache: { },
      ...
    

    Pretty cut and dry.

    How are we to know if other oddities won't show up?

    And is trying to support such an old version of Firefox worth the forking we will have to do to maintain support for the older browser?

  • Juriy Zaytsev

    Juriy Zaytsev April 25th, 2008 @ 04:48 AM

    @John

    I don't think it's worth it - I was just curious : )

  • chris.kreager@gmail.com

    chris.kreager@gmail.com April 25th, 2008 @ 05:19 AM

    I'll let you guys decide on the support/forking value. We are very happy with Prototype "as is" but our appliance products have to work with SUN OS, which use this browser as default. So we test and debug issues as the come up. I've been patching internaly and just thought I'd share any workarounds if find.

    After patching jstest.rb and Rakefile is was able to unit test on Mozilla.

    Only 5 out of 321 test faild after applying the dom.js patch.

    Before the patch, as you said, zero passed - not supported.

    Not too many oddities, but I'll attach the unit test results for you to decide if its worth me committing my changes to the git repo or not.

  • John-David Dalton

    John-David Dalton April 25th, 2008 @ 05:27 AM

    Well Chris now I am curious too :P,

    Please update this ticket with your findings/modifications

    when you run into problems :)

  • chris.kreager@gmail.com

    chris.kreager@gmail.com April 25th, 2008 @ 05:28 AM

    @Juriy

    Yes,

      var cache = new Object;
    
    • only 5 out of 321 test fail.

    So same results as attached log file.

  • Juriy Zaytsev

    Juriy Zaytsev April 25th, 2008 @ 05:33 AM

    Chris,

    it would be great if you could fork the prototype http://github.com/sstephenson/pr... and have the patched version publicly available for other folks to use (in case support of ancient browsers is viable). I'm sure other people would be glad to help/work on your fork.

    Best,

    kangax

  • chris.kreager@gmail.com

    chris.kreager@gmail.com April 25th, 2008 @ 05:49 AM

    @John

    What do you think about a fork?

    I’ve attached the patch for review, using Juriy's suggestion.

    Thanks,

    Chris

  • John-David Dalton

    John-David Dalton April 25th, 2008 @ 06:30 AM

    I think forking is great I have one as well:

    http://github.com/jdalton/protot...

    When you start one I will certaining follow it :)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Prototype JavaScript library.

Shared Ticket Bins

Pages