test_setBreakpoint-at-the-beginning-of-a-minified-fn.js (1392B)
1 "use strict"; 2 3 const SOURCE_URL = getFileUrl("setBreakpoint-on-column-minified.js"); 4 5 add_task( 6 threadFrontTest( 7 async ({ threadFront, debuggee }) => { 8 const promise = waitForNewSource(threadFront, SOURCE_URL); 9 loadSubScript(SOURCE_URL, debuggee); 10 const { source } = await promise; 11 12 // Pause inside of the nested function so we can make sure that we don't 13 // add any other breakpoints at other places on this line. 14 const location = { sourceUrl: source.url, line: 3, column: 56 }; 15 setBreakpoint(threadFront, location); 16 17 const packet = await executeOnNextTickAndWaitForPause(function () { 18 Cu.evalInSandbox("f()", debuggee); 19 }, threadFront); 20 21 const why = packet.why; 22 Assert.equal(why.type, "breakpoint"); 23 Assert.equal(why.actors.length, 1); 24 25 const frame = packet.frame; 26 const where = frame.where; 27 Assert.equal(where.actor, source.actor); 28 Assert.equal(where.line, location.line); 29 Assert.equal(where.column, 56); 30 31 const environment = await packet.frame.getEnvironment(); 32 const variables = environment.bindings.variables; 33 Assert.equal(variables.a.value.type, "undefined"); 34 Assert.equal(variables.b.value.type, "undefined"); 35 Assert.equal(variables.c.value.type, "undefined"); 36 37 await resume(threadFront); 38 }, 39 { doNotRunWorker: true } 40 ) 41 );