Bug 669670 - Remove workaround for getOwnPropertyDescriptor from chrome code; r=mihai.sucan,dtownsend

This commit is contained in:
Panos Astithas 2011-07-08 12:21:45 +03:00
Родитель 79f3f90c34
Коммит 2a980fed83
2 изменённых файлов: 5 добавлений и 13 удалений

Просмотреть файл

@ -4037,8 +4037,6 @@ function findCompletionBeginning(aStr)
function JSPropertyProvider(aScope, aInputValue)
{
let obj = unwrap(aScope);
// Store the scope object, since obj will be modified later on.
let win = obj;
// Analyse the aInputValue and find the beginning of the last part that
// should be completed.
@ -4077,7 +4075,7 @@ function JSPropertyProvider(aScope, aInputValue)
// Check if prop is a getter function on obj. Functions can change other
// stuff so we can't execute them to get the next object. Stop here.
if (isNonNativeGetter(win, obj, prop)) {
if (isNonNativeGetter(obj, prop)) {
return null;
}
try {

Просмотреть файл

@ -163,9 +163,6 @@ function isNativeFunction(aFunction)
* Tells if the given property of the provided object is a non-native getter or
* not.
*
* @param object aScope
* Scope to use for the check.
*
* @param object aObject
* The object that contains the property.
*
@ -175,14 +172,14 @@ function isNativeFunction(aFunction)
* @return boolean
* True if the given property is a getter, false otherwise.
*/
function isNonNativeGetter(aScope, aObject, aProp) {
function isNonNativeGetter(aObject, aProp) {
if (typeof aObject != "object") {
return false;
}
let desc;
while (aObject) {
try {
if (desc = aScope.Object.getOwnPropertyDescriptor(aObject, aProp)) {
if (desc = Object.getOwnPropertyDescriptor(aObject, aProp)) {
break;
}
}
@ -223,11 +220,8 @@ function namesAndValuesOf(aObject)
continue;
}
// Also skip non-native getters. Pass the content window so that
// getOwnPropertyDescriptor can work later on.
let chromeWindow = Services.wm.getMostRecentWindow("navigator:browser");
let contentWindow = chromeWindow.gBrowser.selectedBrowser.contentWindow;
if (isNonNativeGetter(contentWindow.wrappedJSObject, aObject, propName)) {
// Also skip non-native getters.
if (isNonNativeGetter(aObject, propName)) {
value = ""; // Value is never displayed.
presentable = {type: TYPE_OTHER, display: "Getter"};
}