#27 ✓resolved
John Barnette

Defining new properties on JSland proxies is broken

Reported by John Barnette | 2008-04-03 10:21:31 UTC

Rubyland:

class Foo; end

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

JSland:

foo.bar = "baz!"

foo.bar // => null

Comments and changes to this ticket

  • John Barnette

    John Barnette 2008-04-03 10:30:31 UTC

    • 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.
  • John Barnette

    John Barnette 2008-04-03 10:31:13 UTC

    • Title changed from “Defining new properties on JSland proxies” to “Defining new properties on JSland proxies is broken”
  • John Barnette

    John Barnette 2008-04-14 23:40:57 UTC

    • Assigned user changed from “John Barnette” to “Aaron Patterson”

    Hey, didn't you fix this?

  • Aaron Patterson

    Aaron Patterson 2008-04-15 08:37:10 UTC

    • State changed from “open” to “resolved”

    Yes I did.

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

Tags

Pages