Bug 1765240 - [devtools] Remove unused ObjectActor#ownPropertyNames. r=ochameau,devtools-backward-compat-reviewers,jdescottes.

Differential Revision: https://phabricator.services.mozilla.com/D143974
This commit is contained in:
Nicolas Chevobbe 2022-04-20 08:05:35 +00:00
Родитель ea2f238e7a
Коммит 2e492939c5
9 изменённых файлов: 0 добавлений и 125 удалений

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

@ -53,14 +53,6 @@ class ObjectFront extends FrontClassWithSpec(objectSpec) {
return this._grip.extensible;
}
/**
* Request the names of the properties defined on the object and not its
* prototype.
*/
getOwnPropertyNames() {
return super.ownPropertyNames();
}
/**
* Request the prototype and own properties of the object.
*/

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

@ -268,23 +268,6 @@ const proto = {
return { promiseState };
},
/**
* Handle a protocol request to provide the names of the properties defined on
* the object and not its prototype.
*/
ownPropertyNames: function() {
let props = [];
if (DevToolsUtils.isSafeDebuggerObject(this.obj)) {
try {
props = this.obj.getOwnPropertyNames();
} catch (err) {
// The above can throw when the debuggee does not subsume the object's
// compartment, or for some WrappedNatives like Cu.Sandbox.
}
}
return { ownPropertyNames: props };
},
/**
* Creates an actor to iterate over an object property names and values.
* See PropertyIteratorActor constructor for more info about options param.

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

@ -1,40 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
});
add_task(
threadFrontTest(async ({ threadFront, debuggee }) => {
const packet = await executeOnNextTickAndWaitForPause(
() => evalCode(debuggee),
threadFront
);
const args = packet.frame.arguments;
Assert.equal(args[0].class, "Object");
const objClient = threadFront.pauseGrip(args[0]);
const response = await objClient.getOwnPropertyNames();
Assert.equal(response.ownPropertyNames.length, 3);
Assert.equal(response.ownPropertyNames[0], "a");
Assert.equal(response.ownPropertyNames[1], "b");
Assert.equal(response.ownPropertyNames[2], "c");
await threadFront.resume();
})
);
function evalCode(debuggee) {
debuggee.eval(
function stopMe(arg1) {
debugger;
}.toString()
);
debuggee.eval("stopMe({ a: 1, b: true, c: 'foo' })");
}

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

@ -23,12 +23,6 @@ add_task(
const response = await objectFront.getPrototype();
Assert.ok(response.prototype != undefined);
const protoFront = response.prototype;
const { ownPropertyNames } = await protoFront.getOwnPropertyNames();
Assert.equal(ownPropertyNames.length, 2);
Assert.equal(ownPropertyNames[0], "b");
Assert.equal(ownPropertyNames[1], "c");
await threadFront.resume();
})
);

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

@ -42,9 +42,6 @@ add_task(
Assert.ok(prototype != undefined);
const { ownPropertyNames } = await prototype.getOwnPropertyNames();
Assert.ok(ownPropertyNames.toString != undefined);
await threadFront.resume();
})
);

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

@ -1,38 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that we get the magic properties on Error objects.
add_task(
threadFrontTest(async ({ threadFront, debuggee }) => {
const packet = await executeOnNextTickAndWaitForPause(
() => evalCode(debuggee),
threadFront
);
const args = packet.frame.arguments;
const objClient = threadFront.pauseGrip(args[0]);
const response = await objClient.getOwnPropertyNames();
const opn = response.ownPropertyNames;
Assert.equal(opn.length, 4);
opn.sort();
Assert.equal(opn[0], "columnNumber");
Assert.equal(opn[1], "fileName");
Assert.equal(opn[2], "lineNumber");
Assert.equal(opn[3], "message");
await threadFront.resume();
})
);
function evalCode(debuggee) {
debuggee.eval(
function stopMe(arg1) {
debugger;
}.toString()
);
debuggee.eval("stopMe(new TypeError('error message text'))");
}

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

@ -264,9 +264,6 @@ async function test_unsafe_grips(
slice = await response.slice(0, response.count);
check_properties(slice.ownProperties, data, isUnsafe);
response = await objClient.getOwnPropertyNames();
check_property_names(response.ownPropertyNames, data, isUnsafe);
response = await objClient.getProperty("x");
check_property(response.descriptor, data, isUnsafe);

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

@ -135,7 +135,6 @@ skip-if = true # breakpoint sliding is not supported bug 1525685
[test_listsources-03.js]
[test_new_source-01.js]
[test_new_source-02.js]
[test_objectgrips-01.js]
[test_objectgrips-02.js]
[test_objectgrips-03.js]
[test_objectgrips-04.js]
@ -143,7 +142,6 @@ skip-if = true # breakpoint sliding is not supported bug 1525685
[test_objectgrips-06.js]
[test_objectgrips-07.js]
[test_objectgrips-08.js]
[test_objectgrips-11.js]
[test_objectgrips-14.js]
[test_objectgrips-15.js]
[test_objectgrips-16.js]

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

@ -65,10 +65,6 @@ types.addDictType("object.enumProperties.Options", {
sort: "nullable:boolean",
});
types.addDictType("object.ownPropertyNames", {
ownPropertyNames: "array:string",
});
types.addDictType("object.dependentPromises", {
promises: "array:object.descriptor",
});
@ -138,10 +134,6 @@ const objectSpec = generateActorSpec({
fulfillmentStack: RetVal("array:object.originalSourceLocation"),
},
},
ownPropertyNames: {
request: {},
response: RetVal("object.ownPropertyNames"),
},
prototypeAndProperties: {
request: {},
response: RetVal("object.prototypeproperties"),