B2G/gecko/testing/specialpowers/content/specialpowersAPI.js
/*
 * We want to waive the __exposedProps__ security check for SpecialPowers-wrapped
 * objects. We do this by creating a proxy singleton that just always returns 'rw'
 * for any property name.
 */
We want to waive the __exposedProps__ security check for SpecialPowers-wrapped
objects. We do this by creating a proxy singleton that just always returns 'rw'
for any property name.
We want to waive the __exposedProps__ security check for SpecialPowers - wrapped objects . We do this by creating a proxy singleton that just always returns ' rw ' for any property name .
function ExposedPropsWaiverHandler() {
  var _permit = { value: 'rw', writable: false, configurable: false, enumerable: true };
  return {
    getOwnPropertyDescriptor: function(name) { return _permit; },
    getPropertyDescriptor: function(name) { return _permit; },
    getOwnPropertyNames: function() { throw Error("Can't enumerate ExposedPropsWaiver"); },
    getPropertyNames: function() { throw Error("Can't enumerate ExposedPropsWaiver"); },
    enumerate: function() { throw Error("Can't enumerate ExposedPropsWaiver"); },
    defineProperty: function(name) { throw Error("Can't define props on ExposedPropsWaiver"); },
    delete: function(name) { throw Error("Can't delete props from ExposedPropsWaiver"); }
  };
}
function ExposedPropsWaiverHandler ( ) { var _permit = { value : 'rw' , writable : false , configurable : false , enumerable : true } ; return { getOwnPropertyDescriptor : function ( name ) { return _permit ; } , getPropertyDescriptor : function ( name ) { return _permit ; } , getOwnPropertyNames : function ( ) { throw Error ( "Can't enumerate ExposedPropsWaiver" ) ; } , getPropertyNames : function ( ) { throw Error ( "Can't enumerate ExposedPropsWaiver" ) ; } , enumerate : function ( ) { throw Error ( "Can't enumerate ExposedPropsWaiver" ) ; } , defineProperty : function ( name ) { throw Error ( "Can't define props on ExposedPropsWaiver" ) ; } , delete : function ( name ) { throw Error ( "Can't delete props from ExposedPropsWaiver" ) ; } } ; }
We want to waive the __exposedProps__ security check for SpecialPowers-wrapped
 objects.
We want to waive the __exposedProps__ security check for SpecialPowers - wrapped objects .
// NB: XPConnect denies access if the relevant member of __exposedProps__ is not // enumerable.