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:
Adomas Venčkauskas 2016-09-15 13:29:20 +03:00
parent 3741a75b1d
commit 38df733a37
4 changed files with 10 additions and 7 deletions

View File

@ -36,7 +36,7 @@ try {
var Zotero;
}
Zotero_TranslatorTesters = new function() {
var Zotero_TranslatorTesters = new function() {
const TEST_TYPES = ["web", "import", "export", "search"];
var collectedResults = {};
@ -190,7 +190,7 @@ Zotero_TranslatorTesters = new function() {
* @param {Function} [debugCallback] A function to call to write debug output. If not present,
* Zotero.debug will be used.
*/
Zotero_TranslatorTester = function(translator, type, debugCallback) {
var Zotero_TranslatorTester = function(translator, type, debugCallback) {
this.type = type;
this.translator = translator;
this.output = "";

View File

@ -1741,9 +1741,12 @@ Zotero.Translate.Base.prototype = {
this._sandboxManager = new Zotero.Translate.SandboxManager(this._sandboxLocation);
}
const createArrays = "['creators', 'notes', 'tags', 'seeAlso', 'attachments']";
var src = "var Zotero = {};"+
"Zotero.Item = function (itemType) {"+
"const createArrays = "+createArrays+";"+
var src = "";
if (Zotero.isFx && !Zotero.isBookmarklet) {
src = "var Zotero = {};";
}
src += "Zotero.Item = function (itemType) {"+
"var createArrays = "+createArrays+";"+
"this.itemType = itemType;"+
"for(var i=0, n=createArrays.length; i<n; i++) {"+
"this[createArrays[i]] = [];"+

2
styles

@ -1 +1 @@
Subproject commit 9f54d7c5bf2e75cd0e4be4554c83bde1f8193fce
Subproject commit 942da8d31679e83ff51b15e8fadddcdffdef34fc

@ -1 +1 @@
Subproject commit e102b02ae99d8111e44d981d19518ad1f4ded69b
Subproject commit e04633baeaac2c62eddb4435e517ae7d51c89a73