commit 4984e87ade59276734b4878c2df2b7453cd843f0
parent 12619273b514462e1168edc801c35442ce138026
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 14 Oct 2014 22:42:25 -0400
Reinstate __exposedProps__
This is ignored in Firefox 33, but seemingly still necessary in
Firefox 32
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js
@@ -450,9 +450,11 @@ Zotero.Translate.SandboxManager.prototype = {
"importObject":function(object, passAsFirstArgument, attachTo) {
if(!attachTo) attachTo = this.sandbox.Zotero;
if(attachTo.wrappedJSObject) attachTo = attachTo.wrappedJSObject;
- var sandbox = this.sandbox, me = this;
- for(var key in (object.__exposedProps__ ? object.__exposedProps__ : object)) {
+ var newExposedProps = false, sandbox = this.sandbox, me = this;
+ if(!object.__exposedProps__) newExposedProps = {};
+ for(var key in (newExposedProps ? object : object.__exposedProps__)) {
let localKey = key;
+ if(newExposedProps) newExposedProps[localKey] = "r";
var type = typeof object[localKey];
var isFunction = type === "function";
@@ -490,6 +492,12 @@ Zotero.Translate.SandboxManager.prototype = {
attachTo[localKey] = object[localKey];
}
}
+
+ if(newExposedProps) {
+ attachTo.__exposedProps__ = newExposedProps;
+ } else {
+ attachTo.__exposedProps__ = object.__exposedProps__;
+ }
},
"_canCopy":function(obj) {
@@ -507,7 +515,7 @@ Zotero.Translate.SandboxManager.prototype = {
* @return {Object}
*/
"_copyObject":function(obj, wm) {
- if(!this._canCopy(obj)) return obj
+ if(!this._canCopy(obj)) return obj;
if(!wm) wm = new WeakMap();
var obj2 = (obj.constructor.name === "Array" ? this.sandbox.Array() : this.sandbox.Object());
var wobj2 = obj2.wrappedJSObject ? obj2.wrappedJSObject : obj2;