93
edits
(added docs for more membrane methods) |
(added more docs for membrane functions) |
||
| Line 34: | Line 34: | ||
::<code>membrane.</code>'''getProperty'''(''wrappee'', ''membrane'', ''name'', ''defaultValue'') | ::<code>membrane.</code>'''getProperty'''(''wrappee'', ''membrane'', ''name'', ''defaultValue'') | ||
::This is essentially a JavaScript version of [https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSPropertyOp JSClass.getProperty]; alternatively, it could be described as the analog of Python's <code>__getattr__</code> magic method. ''name'' is the name of the property being accessed, and ''defaultValue'' is the value that JavaScript would ordinarily return. This function should return the value of the property, which may be ''defaultValue'' or something different. | ::This is essentially a JavaScript version of [https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSPropertyOp JSClass.getProperty]; alternatively, it could be described as the analog of Python's <code>__getattr__</code> magic method. ''name'' is the name of the property being accessed, and ''defaultValue'' is the value that JavaScript would ordinarily return. This function should return the value of the property, which may be ''defaultValue'' or something different. Alternatively, the method may also throw an exception. | ||
::<code>membrane.</code>'''setProperty'''(''wrappee'', ''membrane'', ''name'', ''defaultValue'') | |||
::This is essentially a JavaScript version of [https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSPropertyOp JSClass.setProperty]; alternatively, it could be described as the analog of Python's <code>__setattr__</code> magic method. ''name'' is the name of the property being accessed, and ''defaultValue'' is the value that JavaScript would ordinarily set the value of the property to. This function should return the value to set the property to, which may be ''defaultValue'' or something different. Alternatively, the method may also throw an exception. | |||
::<code>membrane.</code>'''addProperty'''(''wrappee'', ''membrane'', ''name'', ''defaultValue'') | |||
::This is essentially a JavaScript version of [https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSPropertyOp JSClass.addProperty], and is called immediately after a new property has been added to ''wrappee''. ''name'' is the name of the property being accessed, and ''defaultValue'' is the value that JavaScript would ordinarily set the initial value of the property to. This function should return the initial value to set the property to, which may be ''defaultValue'' or something different. Alternatively, the method may also throw an exception. | |||
::<code>membrane.</code>'''delProperty'''(''wrappee'', ''membrane'', ''name'') | |||
::This is essentially a JavaScript version of [https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSPropertyOp JSClass.delProperty]; alternatively, it could be described as the analog of Python's <code>__delattr__</code> magic method. ''name'' is the name of the property being deleted. This function should return <code>true</code> if the property can be deleted, and <code>false</code> if not. | |||
=== unwrap() === | === unwrap() === | ||
edits