Fixes overriden Zotero object in connector sandboxes
Occurs when not using `with` statement, which is highly discouraged and unsupported in strict mode.
This commit is contained in:
parent
3741a75b1d
commit
38df733a37
4 changed files with 10 additions and 7 deletions
|
@ -36,7 +36,7 @@ try {
|
||||||
var Zotero;
|
var Zotero;
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero_TranslatorTesters = new function() {
|
var Zotero_TranslatorTesters = new function() {
|
||||||
const TEST_TYPES = ["web", "import", "export", "search"];
|
const TEST_TYPES = ["web", "import", "export", "search"];
|
||||||
var collectedResults = {};
|
var collectedResults = {};
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ Zotero_TranslatorTesters = new function() {
|
||||||
* @param {Function} [debugCallback] A function to call to write debug output. If not present,
|
* @param {Function} [debugCallback] A function to call to write debug output. If not present,
|
||||||
* Zotero.debug will be used.
|
* Zotero.debug will be used.
|
||||||
*/
|
*/
|
||||||
Zotero_TranslatorTester = function(translator, type, debugCallback) {
|
var Zotero_TranslatorTester = function(translator, type, debugCallback) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.translator = translator;
|
this.translator = translator;
|
||||||
this.output = "";
|
this.output = "";
|
||||||
|
|
|
@ -1741,9 +1741,12 @@ Zotero.Translate.Base.prototype = {
|
||||||
this._sandboxManager = new Zotero.Translate.SandboxManager(this._sandboxLocation);
|
this._sandboxManager = new Zotero.Translate.SandboxManager(this._sandboxLocation);
|
||||||
}
|
}
|
||||||
const createArrays = "['creators', 'notes', 'tags', 'seeAlso', 'attachments']";
|
const createArrays = "['creators', 'notes', 'tags', 'seeAlso', 'attachments']";
|
||||||
var src = "var Zotero = {};"+
|
var src = "";
|
||||||
"Zotero.Item = function (itemType) {"+
|
if (Zotero.isFx && !Zotero.isBookmarklet) {
|
||||||
"const createArrays = "+createArrays+";"+
|
src = "var Zotero = {};";
|
||||||
|
}
|
||||||
|
src += "Zotero.Item = function (itemType) {"+
|
||||||
|
"var createArrays = "+createArrays+";"+
|
||||||
"this.itemType = itemType;"+
|
"this.itemType = itemType;"+
|
||||||
"for(var i=0, n=createArrays.length; i<n; i++) {"+
|
"for(var i=0, n=createArrays.length; i<n; i++) {"+
|
||||||
"this[createArrays[i]] = [];"+
|
"this[createArrays[i]] = [];"+
|
||||||
|
|
2
styles
2
styles
|
@ -1 +1 @@
|
||||||
Subproject commit 9f54d7c5bf2e75cd0e4be4554c83bde1f8193fce
|
Subproject commit 942da8d31679e83ff51b15e8fadddcdffdef34fc
|
|
@ -1 +1 @@
|
||||||
Subproject commit e102b02ae99d8111e44d981d19518ad1f4ded69b
|
Subproject commit e04633baeaac2c62eddb4435e517ae7d51c89a73
|
Loading…
Add table
Add a link
Reference in a new issue