93
edits
(→Security Concerns: added more notes) |
(added docs for call and construct) |
||
| Line 34: | Line 34: | ||
''membrane'' should be a JavaScript object with any of the following methods defined: | ''membrane'' should be a JavaScript object with any of the following methods defined: | ||
::<code>membrane.</code>'''call'''(''wrappee'', ''membrane'', ''thisObj'', ''args'') | |||
::This is essentially a JavaScript version of [https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.call JSClass.call]; alternatively, it could be described as the analog of Python's <code>__call__</code> magic method. ''thisObj'' is the object that the callee's <code>this</code> variable should be set to, and ''args'' is the array of arguments to be passed to the callee. This method should return whatever the return value of the callee is, or raise an exception. | |||
::<code>membrane.</code>'''construct'''(''wrappee'', ''membrane'', ''thisObj'', ''args'') | |||
::This is essentially a JavaScript version of [https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.construct JSClass.construct]. It's just like ''membrane.''<code>call()</code>, only it's called when the call is preceded by the <code>new</code> operator. | |||
::<code>membrane.</code>'''convert'''(''wrappee'', ''membrane'', ''type'') | ::<code>membrane.</code>'''convert'''(''wrappee'', ''membrane'', ''type'') | ||
edits