#10 ✓invalid
John Barnette

RubyLandProxy#length (and #size) Masking Problems

Reported by John Barnette | March 19th, 2008 @ 08:32 PM

The current implementation of length/size on Proxy masks properties and function calls of the same name on the proxied JS object.

Comments and changes to this ticket

  • John Barnette

    John Barnette April 3rd, 2008 @ 10:35 AM

    • State changed from “new” to “open”
    • Title changed from “Proxy#length (and #size) Masking Problems” to “RubyProxy#length (and #size) Masking Problems”

    I think this is okay for 1.0. Let's address it when something blows up. We can always provide a js property that sidesteps all of the proxy methods:

    # calls/gets the JSland size method/property,
    # not the RubyProxy/Enumerable method
  • John Barnette
  • John Barnette

    John Barnette April 21st, 2008 @ 09:52 PM

    • Title changed from “RubyProxy#length (and #size) Masking Problems” to “RubyLandProxy#length (and #size) Masking Problems”
  • Aman Gupta

    Aman Gupta January 20th, 2009 @ 02:16 AM

    Something blew up =)

    js> document.childNodes
    => #<Nokogiri::DOM::NodeList:0x1273f0c
    js> document.childNodes.__send__('respond_to?', 'js_property?')
    => true
    js> document.childNodes.__send__('js_property?', 'length')
    => true
    js> document.childNodes.length
    => nil
    js> document.childNodes.length()
    => 2
  • John Barnette

    John Barnette July 29th, 2009 @ 02:37 PM

    • State changed from “open” to “invalid”

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 ยป

People watching this ticket