зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1450541 - Show values of non-enumerable symbol properties in object inspector r=nchevobbe
MozReview-Commit-ID: Ai6q61YVzMk --HG-- extra : rebase_source : 25b23bfd14ac717309f62cfb1548763ca3bf8aaf
This commit is contained in:
Родитель
f9f0b80f55
Коммит
dc2389178e
|
@ -1212,7 +1212,7 @@ function SymbolIteratorActor(objectActor) {
|
||||||
const symbol = symbols[index];
|
const symbol = symbols[index];
|
||||||
return {
|
return {
|
||||||
name: symbol.toString(),
|
name: symbol.toString(),
|
||||||
descriptor: objectActor._propertyDescriptor(symbol, true)
|
descriptor: objectActor._propertyDescriptor(symbol)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
/* eslint-disable no-shadow, max-nested-callbacks */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var gDebuggee;
|
||||||
|
var gThreadClient;
|
||||||
|
|
||||||
|
add_task(async function run_test() {
|
||||||
|
await run_test_with_server(DebuggerServer);
|
||||||
|
await run_test_with_server(WorkerDebuggerServer);
|
||||||
|
});
|
||||||
|
|
||||||
|
async function run_test_with_server(server) {
|
||||||
|
initTestDebuggerServer(server);
|
||||||
|
let title = "test_enum_symbols";
|
||||||
|
gDebuggee = addTestGlobal(title, server);
|
||||||
|
gDebuggee.eval(function stopMe(arg) {
|
||||||
|
debugger;
|
||||||
|
}.toString());
|
||||||
|
let client = new DebuggerClient(server.connectPipe());
|
||||||
|
await client.connect();
|
||||||
|
[,, gThreadClient] = await attachTestTabAndResume(client, title);
|
||||||
|
await test_enum_symbols();
|
||||||
|
await client.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function test_enum_symbols() {
|
||||||
|
await new Promise(function(resolve) {
|
||||||
|
gThreadClient.addOneTimeListener("paused", async function(event, packet) {
|
||||||
|
let [grip] = packet.frame.arguments;
|
||||||
|
let objClient = gThreadClient.pauseGrip(grip);
|
||||||
|
let {iterator} = await objClient.enumSymbols();
|
||||||
|
let {ownSymbols} = await iterator.slice(0, iterator.count);
|
||||||
|
|
||||||
|
strictEqual(ownSymbols.length, 1, "There is 1 symbol property.");
|
||||||
|
let {name, descriptor} = ownSymbols[0];
|
||||||
|
strictEqual(name, "Symbol(sym)", "Got right symbol name.");
|
||||||
|
deepEqual(descriptor, {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
value: 1,
|
||||||
|
}, "Got right property descriptor.");
|
||||||
|
|
||||||
|
await gThreadClient.resume();
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
gDebuggee.eval(`stopMe(Object.defineProperty({}, Symbol("sym"), {value: 1}));`);
|
||||||
|
});
|
||||||
|
}
|
|
@ -174,6 +174,7 @@ reason = bug 1104838
|
||||||
[test_objectgrips-19.js]
|
[test_objectgrips-19.js]
|
||||||
[test_objectgrips-20.js]
|
[test_objectgrips-20.js]
|
||||||
[test_objectgrips-21.js]
|
[test_objectgrips-21.js]
|
||||||
|
[test_objectgrips-22.js]
|
||||||
[test_objectgrips-array-like-object.js]
|
[test_objectgrips-array-like-object.js]
|
||||||
[test_promise_state-01.js]
|
[test_promise_state-01.js]
|
||||||
[test_promise_state-02.js]
|
[test_promise_state-02.js]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче