The documentation for Scriptable "put"

http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Scriptable.html#put(java.lang.String,%20org.mozilla.javascript.Scriptable,%20java.lang.Object)

describes the second parameter "start"

> Note that if a property a is defined in the prototype p
> of an object o, then evaluating o.a = 23 will cause set

What does "set" mean specifically? I don't think "set" is referring to
some ECMA property that are usually in double brackets.

> to be called on the prototype p with o as the start
> parameter. To preserve JavaScript semantics, it is the
> Scriptable object's responsibility to modify o.

"the Scriptable object" refers to "o" or "p"? They could both be
ScriptableObject instances, yes?

I don't understand what the above is trying to say. To me, evaluating
"o.a = 23" should set a value on "o" itself and not on o's prototype.
If objects "n" and "o" both share the same prototype "p", then
evaluating "o.a = 23" should not set the value "a" on prototype "p" as
that would affect "n". I imagine that Rhino is doing the right thing
but the above documentation seems misleading/confusing to me.

> This design allows properties to be defined in prototypes
> and implemented in terms of getters and setters of Java
> values without consuming slots in each instance.

Equally confused by this second paragraph.

If someone explains what the documentation is trying to explain, I'll
submit a documentation patch.

Thanks,
Peter
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to