зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1480678 part 4 - Use current global as conversion scope in the Xray case when wrapping the return value in generated bindings. r=bz
This commit is contained in:
Родитель
ef4718f482
Коммит
ff502e7cc6
|
@ -7871,7 +7871,10 @@ class CGPerSignatureCall(CGThing):
|
|||
slotStorageSteps += preserveWrapper
|
||||
|
||||
if checkForXray:
|
||||
conversionScope = "isXray ? obj : slotStorage"
|
||||
# In the Xray case we use the current global as conversion
|
||||
# scope, as explained in the big compartment/conversion comment
|
||||
# above.
|
||||
conversionScope = "isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage"
|
||||
else:
|
||||
conversionScope = "slotStorage"
|
||||
|
||||
|
@ -7879,7 +7882,7 @@ class CGPerSignatureCall(CGThing):
|
|||
"""
|
||||
{
|
||||
JS::Rooted<JSObject*> conversionScope(cx, ${conversionScope});
|
||||
JSAutoRealmAllowCCW ar(cx, conversionScope);
|
||||
JSAutoRealm ar(cx, conversionScope);
|
||||
do { // block we break out of when done wrapping
|
||||
$*{wrapCode}
|
||||
} while (false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче