Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Defining new properties on JSland proxies is broken

#27

Rubyland:

class Foo; end

ctx = Johnson::Context.new
ctx[:foo] = Foo.new

JSland:

foo.bar = "baz!"

foo.bar // => null

Reported by John Barnette · April 3rd, 2008 @ 10:21 AM

State: resolved
Milestone: none
Assigned to: Aaron Patterson Aaron Patterson

Activity

  1. John Barnette
    John Barnette
    • State changed from new to open

    This is because the JSProxy defines property getters and setters itself, passing them all through to Ruby. What we should really do:

    Setting the foo property on bar

    • Is there a foo= method? If so, invoke it.
    • Is bar indexable? If so, invoke bar['foo']=.
    • [NEW] Set foo as a "JSland only" property.

    Getting the foo property on bar

    • Is there a 0-arity foo method? If so, invoke it.
    • Is bar indexable? If so, invoke bar['foo']
    • [NEW] Retrieve foo from "JSLand only" properties, returning null if it's nonexistent.

    April 3rd, 2008 @ 10:30 AM

  2. John Barnette
    John Barnette
    • Title changed from Defining new properties on JSland proxies to Defining new properties on JSland proxies is broken

    April 3rd, 2008 @ 10:31 AM

  3. John Barnette
    John Barnette
    • Assigned user changed from John Barnette to Aaron Patterson

    Hey, didn't you fix this?

    April 14th, 2008 @ 11:40 PM

  4. Aaron Patterson
    Aaron Patterson
    • State changed from open to resolved

    Yes I did.

    April 15th, 2008 @ 08:37 AM

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.