зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 352bd579f519 (bug 1594941) for failing xpcshell at test_breakpoint-16.js on a CLOSED TREE
This commit is contained in:
Родитель
30c26d0a23
Коммит
47d35b097d
|
@ -328,6 +328,10 @@ function getProperties(thread: string, grip: Grip): Promise<*> {
|
|||
}
|
||||
|
||||
async function getFrameScopes(frame: Frame): Promise<*> {
|
||||
if (frame.scope) {
|
||||
return frame.scope;
|
||||
}
|
||||
|
||||
const frameFront = lookupThreadFront(frame.thread).get(frame.id);
|
||||
return frameFront.getEnvironment();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ export function createFrame(
|
|||
generatedLocation: location,
|
||||
this: frame.this,
|
||||
source: null,
|
||||
scope: frame.environment,
|
||||
index,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ export type FramePacket = {|
|
|||
+actor: ActorId,
|
||||
+arguments: any[],
|
||||
+displayName: string,
|
||||
+environment: any,
|
||||
+this: any,
|
||||
+depth?: number,
|
||||
+oldest?: boolean,
|
||||
|
@ -91,6 +92,7 @@ export type FrameFront = {
|
|||
actorID: string,
|
||||
displayName: string,
|
||||
this: any,
|
||||
environment: any,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -249,7 +249,7 @@ export type Frame = {
|
|||
location: SourceLocation,
|
||||
generatedLocation: SourceLocation,
|
||||
source: ?Source,
|
||||
scope?: Scope,
|
||||
scope: Scope,
|
||||
// FIXME Define this type more clearly
|
||||
this: Object,
|
||||
framework?: string,
|
||||
|
|
|
@ -27,10 +27,6 @@ describe("scopes", () => {
|
|||
const scope = makeMockScope("actor1");
|
||||
const selectedFrame = makeMockFrame(undefined, undefined, scope);
|
||||
|
||||
if (!selectedFrame.scope) {
|
||||
throw new Error("Frame must include scopes");
|
||||
}
|
||||
|
||||
const frameScopes = convertScope(selectedFrame.scope);
|
||||
const scopes = getScopes(pauseData, selectedFrame, frameScopes);
|
||||
if (!scopes) {
|
||||
|
@ -51,10 +47,6 @@ describe("scopes", () => {
|
|||
const selectedFrame = makeMockFrame(undefined, undefined, scope1);
|
||||
mockScopeAddVariable(scope0, "foo");
|
||||
|
||||
if (!selectedFrame.scope) {
|
||||
throw new Error("Frame must include scopes");
|
||||
}
|
||||
|
||||
const frameScopes = convertScope(selectedFrame.scope);
|
||||
const scopes = getScopes(pauseData, selectedFrame, frameScopes);
|
||||
if (!scopes) {
|
||||
|
@ -73,10 +65,6 @@ describe("scopes", () => {
|
|||
const scope = makeMockScope("actor1");
|
||||
const selectedFrame = makeMockFrame(undefined, undefined, scope);
|
||||
|
||||
if (!selectedFrame.scope) {
|
||||
throw new Error("Frame must include scopes");
|
||||
}
|
||||
|
||||
const frameScopes = convertScope(selectedFrame.scope);
|
||||
const scopes = getScopes(why, selectedFrame, frameScopes);
|
||||
expect(scopes).toMatchObject([
|
||||
|
@ -107,10 +95,6 @@ describe("scopes", () => {
|
|||
const scope = makeMockScope("actor1");
|
||||
const selectedFrame = makeMockFrame(undefined, undefined, scope);
|
||||
|
||||
if (!selectedFrame.scope) {
|
||||
throw new Error("Frame must include scopes");
|
||||
}
|
||||
|
||||
const frameScopes = convertScope(selectedFrame.scope);
|
||||
const scopes = getScopes(why, selectedFrame, frameScopes);
|
||||
expect(scopes).toMatchObject([
|
||||
|
|
|
@ -8,6 +8,7 @@ var Services = require("Services");
|
|||
exports.defaultThreadOptions = function() {
|
||||
return {
|
||||
autoBlackBox: false,
|
||||
ignoreFrameEnvironment: true,
|
||||
pauseOnExceptions: Services.prefs.getBoolPref(
|
||||
"devtools.debugger.pause-on-exceptions"
|
||||
),
|
||||
|
|
|
@ -91,6 +91,15 @@ const FrameActor = ActorClassWithSpec(frameSpec, {
|
|||
form.depth = this.depth;
|
||||
}
|
||||
|
||||
// NOTE: ignoreFrameEnvironment lets the client explicitly avoid
|
||||
// populating form environments on pause.
|
||||
if (
|
||||
!this.threadActor._options.ignoreFrameEnvironment &&
|
||||
this.frame.environment
|
||||
) {
|
||||
form.environment = this.getEnvironment();
|
||||
}
|
||||
|
||||
if (this.frame.type != "wasmcall") {
|
||||
form.this = createValueGrip(
|
||||
this.frame.this,
|
||||
|
|
|
@ -27,13 +27,7 @@ add_task(
|
|||
while (timesBreakpointHit < 3) {
|
||||
await resume(threadFront);
|
||||
const packet = await waitForPause(threadFront);
|
||||
await testAssertions(
|
||||
packet,
|
||||
debuggee,
|
||||
source,
|
||||
location,
|
||||
timesBreakpointHit
|
||||
);
|
||||
testAssertions(packet, debuggee, source, location, timesBreakpointHit);
|
||||
|
||||
timesBreakpointHit++;
|
||||
}
|
||||
|
@ -53,7 +47,7 @@ function evaluateTestCode(debuggee) {
|
|||
/* eslint-enable */
|
||||
}
|
||||
|
||||
async function testAssertions(
|
||||
function testAssertions(
|
||||
packet,
|
||||
debuggee,
|
||||
source,
|
||||
|
@ -66,6 +60,8 @@ async function testAssertions(
|
|||
Assert.equal(packet.frame.where.column, location.column);
|
||||
|
||||
Assert.equal(debuggee.acc, timesBreakpointHit);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(environment.bindings.variables.i.value, timesBreakpointHit);
|
||||
Assert.equal(
|
||||
packet.frame.environment.bindings.variables.i.value,
|
||||
timesBreakpointHit
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ add_task(
|
|||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const bindings = environment.bindings;
|
||||
const bindings = packet.frame.environment.bindings;
|
||||
const args = bindings.arguments;
|
||||
const vars = bindings.variables;
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ add_task(
|
|||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
let parentEnv = environment.parent;
|
||||
let parentEnv = packet.frame.environment.parent;
|
||||
const bindings = parentEnv.bindings;
|
||||
const args = bindings.arguments;
|
||||
const vars = bindings.variables;
|
||||
|
|
|
@ -24,7 +24,7 @@ add_task(
|
|||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const env = await packet.frame.getEnvironment();
|
||||
const env = packet.frame.environment;
|
||||
Assert.notEqual(env, undefined);
|
||||
|
||||
const parentEnv = env.parent;
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(
|
|||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const env = await packet.frame.getEnvironment();
|
||||
const env = packet.frame.environment;
|
||||
Assert.notEqual(env, undefined);
|
||||
|
||||
const objClient = gThreadFront.pauseGrip(env.object);
|
||||
|
|
|
@ -24,7 +24,7 @@ add_task(
|
|||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const env = await packet.frame.getEnvironment();
|
||||
const env = packet.frame.environment;
|
||||
Assert.notEqual(env, undefined);
|
||||
|
||||
const objClient = gThreadFront.pauseGrip(env.object);
|
||||
|
|
|
@ -19,7 +19,7 @@ add_task(
|
|||
|
||||
function test_banana_environment() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const env = await packet.frame.getEnvironment();
|
||||
const env = packet.frame.environment;
|
||||
equal(env.type, "function");
|
||||
equal(env.function.name, "banana3");
|
||||
let parent = env.parent;
|
||||
|
|
|
@ -23,7 +23,7 @@ add_task(
|
|||
|
||||
function test_banana_environment() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const environment = packet.frame.environment;
|
||||
Assert.equal(environment.type, "function");
|
||||
|
||||
const parent = environment.parent;
|
||||
|
|
|
@ -22,8 +22,7 @@ add_task(
|
|||
|
||||
function test_object_grip() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const person = environment.bindings.variables.person;
|
||||
const person = packet.frame.environment.bindings.variables.person;
|
||||
|
||||
Assert.equal(person.value.class, "Object");
|
||||
|
||||
|
|
|
@ -37,15 +37,13 @@ function evalCode() {
|
|||
const testObjectGroup = async function() {
|
||||
let packet = await executeOnNextTickAndWaitForPause(evalCode, gThreadFront);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const ugh = environment.parent.parent.bindings.variables.ugh;
|
||||
const ugh = packet.frame.environment.parent.parent.bindings.variables.ugh;
|
||||
const ughClient = await gThreadFront.pauseGrip(ugh.value);
|
||||
|
||||
packet = await getPrototypeAndProperties(ughClient);
|
||||
packet = await resumeAndWaitForPause(gThreadFront);
|
||||
|
||||
const environment2 = await packet.frame.getEnvironment();
|
||||
const ugh2 = environment2.bindings.variables.ugh;
|
||||
const ugh2 = packet.frame.environment.bindings.variables.ugh;
|
||||
const ugh2Client = gThreadFront.pauseGrip(ugh2.value);
|
||||
|
||||
packet = await getPrototypeAndProperties(ugh2Client);
|
||||
|
|
|
@ -37,15 +37,13 @@ function evalCode() {
|
|||
const testObjectGroup = async function() {
|
||||
let packet = await executeOnNextTickAndWaitForPause(evalCode, gThreadFront);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const ugh = environment.parent.bindings.variables.ugh;
|
||||
const ugh = packet.frame.environment.parent.bindings.variables.ugh;
|
||||
const ughClient = await gThreadFront.pauseGrip(ugh.value);
|
||||
|
||||
packet = await getPrototypeAndProperties(ughClient);
|
||||
|
||||
packet = await resumeAndWaitForPause(gThreadFront);
|
||||
const environment2 = await packet.frame.getEnvironment();
|
||||
const ugh2 = environment2.parent.bindings.variables.ugh;
|
||||
const ugh2 = packet.frame.environment.parent.bindings.variables.ugh;
|
||||
const ugh2Client = gThreadFront.pauseGrip(ugh2.value);
|
||||
|
||||
packet = await getPrototypeAndProperties(ugh2Client);
|
||||
|
|
|
@ -16,9 +16,7 @@ add_task(
|
|||
threadFront
|
||||
);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const grip = environment.bindings.variables.p;
|
||||
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "pending");
|
||||
|
|
|
@ -16,9 +16,7 @@ add_task(
|
|||
threadFront
|
||||
);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const grip = environment.bindings.variables.p;
|
||||
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "fulfilled");
|
||||
|
|
|
@ -16,8 +16,7 @@ add_task(
|
|||
threadFront
|
||||
);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const grip = environment.bindings.variables.p;
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "rejected");
|
||||
|
|
|
@ -28,8 +28,7 @@ add_task(
|
|||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, 56);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value.type, "undefined");
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -28,8 +28,7 @@ add_task(
|
|||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, 81);
|
||||
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value, 2);
|
||||
Assert.equal(variables.c.value, 3);
|
||||
|
|
|
@ -27,7 +27,6 @@ add_task(
|
|||
});
|
||||
});
|
||||
}, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
|
@ -35,7 +34,7 @@ add_task(
|
|||
const where = frame.where;
|
||||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, location.column);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -15,7 +15,6 @@ add_task(
|
|||
const packet = await executeOnNextTickAndWaitForPause(function() {
|
||||
Cu.evalInSandbox("f()", debuggee);
|
||||
}, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
|
@ -24,7 +23,7 @@ add_task(
|
|||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, location.column);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -28,13 +28,12 @@ add_task(
|
|||
});
|
||||
}, threadFront);
|
||||
const why = packet.why;
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
const frame = packet.frame;
|
||||
const where = frame.where;
|
||||
Assert.equal(where.line, location.line);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -17,14 +17,13 @@ add_task(
|
|||
Cu.evalInSandbox("f()", debuggee);
|
||||
}, threadFront);
|
||||
let why = packet.why;
|
||||
let environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
let frame = packet.frame;
|
||||
let where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
let variables = environment.bindings.variables;
|
||||
let variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.i.value.type, "undefined");
|
||||
|
||||
const location2 = { sourceUrl: sourceFront.url, line: 7 };
|
||||
|
@ -34,7 +33,6 @@ add_task(
|
|||
() => resume(threadFront),
|
||||
threadFront
|
||||
);
|
||||
environment = await packet.frame.getEnvironment();
|
||||
why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
|
@ -42,7 +40,7 @@ add_task(
|
|||
where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, location2.line);
|
||||
variables = environment.bindings.variables;
|
||||
variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.i.value, 1);
|
||||
|
||||
await resume(threadFront);
|
||||
|
|
|
@ -19,14 +19,13 @@ add_task(
|
|||
Cu.evalInSandbox("f()", debuggee);
|
||||
}, threadFront);
|
||||
const why = packet.why;
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
const frame = packet.frame;
|
||||
const where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value.type, "undefined");
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -35,7 +35,6 @@ add_task(
|
|||
});
|
||||
});
|
||||
}, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(packet.type, "paused");
|
||||
const why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
|
@ -45,7 +44,7 @@ add_task(
|
|||
const where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, 8);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ add_task(
|
|||
packet = await executeOnNextTickAndWaitForPause(function() {
|
||||
Cu.evalInSandbox("f()", debuggee);
|
||||
}, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
Assert.equal(packet.type, "paused");
|
||||
const why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
|
@ -33,7 +32,7 @@ add_task(
|
|||
const where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, actualLocation.line);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ add_task(
|
|||
const packet = await executeOnNextTickAndWaitForPause(function() {
|
||||
Cu.evalInSandbox("f()", debuggee);
|
||||
}, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
|
@ -24,7 +23,7 @@ add_task(
|
|||
const where = frame.where;
|
||||
Assert.equal(where.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
const variables = environment.bindings.variables;
|
||||
const variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
|
|
@ -34,12 +34,11 @@ async function testSymbols(threadFront, debuggee) {
|
|||
};
|
||||
|
||||
const packet = await executeOnNextTickAndWaitForPause(evalCode, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const {
|
||||
symbolWithName,
|
||||
symbolWithoutName,
|
||||
iteratorSymbol,
|
||||
} = environment.bindings.variables;
|
||||
} = packet.frame.environment.bindings.variables;
|
||||
|
||||
equal(symbolWithName.value.type, "symbol");
|
||||
equal(symbolWithName.value.name, "Chris");
|
||||
|
|
|
@ -35,8 +35,7 @@ async function testSymbols(threadFront, debuggee) {
|
|||
};
|
||||
|
||||
const packet = await executeOnNextTickAndWaitForPause(evalCode, threadFront);
|
||||
const environment = await packet.frame.getEnvironment();
|
||||
const { sym } = environment.bindings.variables;
|
||||
const { sym } = packet.frame.environment.bindings.variables;
|
||||
|
||||
equal(sym.value.type, "symbol");
|
||||
equal(sym.value.name, "le troll");
|
||||
|
|
Загрузка…
Ссылка в новой задаче