Disable argument unwrapping on Fx < 32
This apparently breaks on Fx 24
This commit is contained in:
parent
dd5160cc73
commit
8cb081a4e1
|
@ -462,9 +462,14 @@ Zotero.Translate.SandboxManager.prototype = {
|
||||||
if(isFunction) {
|
if(isFunction) {
|
||||||
attachTo[localKey] = function() {
|
attachTo[localKey] = function() {
|
||||||
var args = Array.prototype.slice.apply(arguments);
|
var args = Array.prototype.slice.apply(arguments);
|
||||||
for(var i=0; i<args.length; i++) {
|
if(Zotero.platformMajorVersion >= 32) {
|
||||||
if(typeof args[i] === "object" && args[i] !== null && args[i].wrappedJSObject) {
|
// This is necessary on Nightly and works
|
||||||
args[i] = args[i].wrappedJSObject;
|
// fine on 31, but apparently ZU.xpath in
|
||||||
|
// an unusual way on 24
|
||||||
|
for(var i=0; i<args.length; i++) {
|
||||||
|
if(typeof args[i] === "object" && args[i] !== null && args[i].wrappedJSObject) {
|
||||||
|
args[i] = args[i].wrappedJSObject;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(passAsFirstArgument) args.unshift(passAsFirstArgument);
|
if(passAsFirstArgument) args.unshift(passAsFirstArgument);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user