Bug 1233497 - Temporarily allow unsafe CPOWs in Promise-backend.js and Task.jsm. r?billm
--- a/toolkit/modules/Promise-backend.js
+++ b/toolkit/modules/Promise-backend.js
@@ -51,16 +51,20 @@ var Components_ = this.require ? require
// If Cu is defined, use it to lazily define the FinalizationWitnessService.
if (Cu) {
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "FinalizationWitnessService",
"@mozilla.org/toolkit/finalizationwitness;1",
"nsIFinalizationWitnessService");
+
+ // For now, we're worried about add-ons using Promises with CPOWs, so we'll
+ // permit them in this scope, but this support will go away soon.
+ Cu.permitCPOWsInScope(this);
}
const STATUS_PENDING = 0;
const STATUS_RESOLVED = 1;
const STATUS_REJECTED = 2;
// This N_INTERNALS name allow internal properties of the Promise to be
// accessed only by this module, while still being visible on the object
--- a/toolkit/modules/Task.jsm
+++ b/toolkit/modules/Task.jsm
@@ -86,16 +86,20 @@ this.EXPORTED_SYMBOLS = [
////////////////////////////////////////////////////////////////////////////////
//// Globals
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
+// For now, we're worried about add-ons using Tasks with CPOWs, so we'll
+// permit them in this scope, but this support will go away soon.
+Cu.permitCPOWsInScope(this);
+
Cu.import("resource://gre/modules/Promise.jsm");
// The following error types are considered programmer errors, which should be
// reported (possibly redundantly) so as to let programmers fix their code.
const ERRORS_TO_REPORT = ["EvalError", "RangeError", "ReferenceError", "TypeError"];
/**
* The Task currently being executed