Labs/Jetpack/Binary Components: Difference between revisions

→‎Flexible Membrane Functionality: added docs for membrane.enumerate()
(added some docs for wrap().)
(→‎Flexible Membrane Functionality: added docs for membrane.enumerate())
Line 26: Line 26:
::<code>membrane.</code>'''resolve'''(''wrappee'', ''membrane'', ''name'')
::<code>membrane.</code>'''resolve'''(''wrappee'', ''membrane'', ''name'')


::This is essentially a JavaScript wrapper for [https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.resolve JSClass.resolve].  It's called when the property identified by ''name'' doesn't exist on ''wrappee''.  The membrane should either define ''name'' on ''wrappee'' and return ''wrappee'', or&mdash;if ''name'' doesn't exist&mdash;it should return <code>undefined</code>.
::This is essentially a JavaScript version of [https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.resolve JSClass.resolve].  It's called when the property identified by ''name'' doesn't exist on ''wrappee''.  The membrane should either define ''name'' on ''wrappee'' and return ''wrappee'', or&mdash;if ''name'' doesn't exist&mdash;it should return <code>undefined</code>.
 
::<code>membrane.</code>'''enumerate'''(''wrappee'', ''membrane'')
 
::This is essentially a JavaScript version of [https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.enumerate JSClass.enumerate].  It should return an iterator that iterates through all the property names in ''wrappee''.


=== unwrap() ===
=== unwrap() ===
93

edits