mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 712649 - Components.utils.getWeakReference(null) should fail silently; r=bholley
This commit is contained in:
parent
0989117a2f
commit
84ddd624f8
@ -49,7 +49,7 @@ nsresult xpcJSWeakReference::Init(JSContext* cx, const JS::Value& object)
|
||||
JSAutoRequest ar(cx);
|
||||
|
||||
if (!object.isObject())
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
|
||||
JSObject& obj = object.toObject();
|
||||
|
||||
|
@ -38,6 +38,14 @@
|
||||
|
||||
function run_test()
|
||||
{
|
||||
// Bug 712649: Calling getWeakReference(null) should work.
|
||||
try {
|
||||
var nullWeak = Components.utils.getWeakReference(null);
|
||||
do_check_true(nullWeak.get() === null);
|
||||
} catch (e) {
|
||||
do_check_true(false);
|
||||
}
|
||||
|
||||
var obj = { num: 5, str: 'foo' };
|
||||
var weak = Components.utils.getWeakReference(obj);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user