Bug 1518661 - Part 3: Adjust call-expression positions. r=jimb,jorendorff

When we mark call expressions as breakpoints, we want to make it as likely
as possible that the call has its own unique positon. The existing logic
means that it is more likely that the beginning of a call will align
with the start of an expression statement or other debuggable step point.
By using the property-access location, we're less likely to collide.

Thid also adds a new bytecodes that were missed in the original code that
added this position handling logic.

Differential Revision: https://phabricator.services.mozilla.com/D17661

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Logan Smyth 2019-02-12 23:46:27 +00:00
Родитель 0368eb5de8
Коммит 2efd56750c
27 изменённых файлов: 315 добавлений и 297 удалений

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

@ -33,7 +33,18 @@ add_task(async function test() {
await selectSource(dbg, "pause-points.js")
await testCase(dbg, {
name: "statements",
steps: [[9,2], [10,4], [10,13], [11,2], [11,21], [12,2], [12,12], [13,0]]
steps: [
[9, 2],
[10, 4],
[10, 13],
[11, 2],
[11, 10],
[11, 21],
[11, 29],
[12, 2],
[12, 12],
[13, 0]
]
});
await testCase(dbg, {
@ -44,11 +55,23 @@ add_task(async function test() {
await testCase(dbg, {
name: "sequences",
steps: [[23,2], [25,8], [29,8], [31,4], [34,2], [37,0]]
});
await testCase(dbg, {
name: "flow",
steps: [[16,2], [17,12], [18,6], [19,2], [19,8], [19,17], [19,8], [19,17], [19,8]]
steps: [
[16, 2],
[17, 12],
[17, 20],
[18, 6],
[19, 2],
[19, 8],
[19, 17],
[19, 25],
[19, 8],
[19, 17],
[19, 25],
[19, 8]
]
});
});

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

@ -30,7 +30,7 @@ add_task(async function() {
invokeInTab("arithmetic");
info("Switch to console and check message");
await waitForConsoleLink(dbg, "math.min.js:3:65");
await waitForConsoleLink(dbg, "math.min.js:3:73");
info("Switch back to debugger and pretty-print");
await dbg.toolbox.selectTool("jsdebugger");

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

@ -50,7 +50,7 @@ function testFocus(sw, hud) {
ok(loc, "location element exists");
is(loc.getAttribute("data-url"), sw.Scratchpad.uniqueName, "location value is correct");
is(loc.getAttribute("data-line"), "1", "line value is correct");
is(loc.getAttribute("data-column"), "1", "column value is correct");
is(loc.getAttribute("data-column"), "9", "column value is correct");
sw.addEventListener("focus", function() {
const win = Services.wm.getMostRecentWindow("devtools:scratchpad");

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

@ -22,7 +22,7 @@ add_task(async function() {
let error = await evalInDebuggee("throwError()");
is(error.lineNumber, 21, "error has correct lineNumber");
is(error.columnNumber, 11, "error has correct columnNumber");
is(error.columnNumber, 18, "error has correct columnNumber");
is(error.name, "TypeError", "error has correct name");
is(error.message, "Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error has correct message");
is(error.stringified, "TypeError: Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error is stringified correctly");

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -23,7 +23,7 @@ stubPreparedMessages.set(`ReferenceError: asdf is not defined`, new ConsoleMessa
"level": "error",
"messageText": "ReferenceError: asdf is not defined",
"parameters": null,
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":3,\"column\":5},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":9,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":20,\"functionName\":null}]}",
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":3,\"column\":5},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":31,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":29,\"functionName\":null}]}",
"stacktrace": [
{
"filename": "http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html",
@ -46,13 +46,13 @@ stubPreparedMessages.set(`ReferenceError: asdf is not defined`, new ConsoleMessa
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],
@ -80,18 +80,18 @@ stubPreparedMessages.set(`SyntaxError: redeclaration of let a`, new ConsoleMessa
"level": "error",
"messageText": "SyntaxError: redeclaration of let a",
"parameters": null,
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":2,\"column\":9},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":\"SyntaxError: redeclaration of let a\",\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":9,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":20,\"functionName\":null}]}",
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":2,\"column\":9},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":\"SyntaxError: redeclaration of let a\",\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":31,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":29,\"functionName\":null}]}",
"stacktrace": [
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],
@ -132,7 +132,7 @@ stubPreparedMessages.set(`TypeError longString message`, new ConsoleMessage({
"actor": "server1.conn0.child1/longString30"
},
"parameters": null,
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":7},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":{\"type\":\"longString\",\"initial\":\"Error: Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Lon\",\"length\":110007,\"actor\":\"server1.conn0.child1/longString30\"},\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":1,\"columnNumber\":7,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":9,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":20,\"functionName\":null}]}",
"repeatId": "{\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":7},\"groupId\":null,\"indent\":0,\"level\":\"error\",\"messageText\":{\"type\":\"longString\",\"initial\":\"Error: Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Lon\",\"length\":110007,\"actor\":\"server1.conn0.child1/longString30\"},\"parameters\":null,\"source\":\"javascript\",\"type\":\"log\",\"userProvidedStyles\":null,\"private\":false,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html\",\"lineNumber\":1,\"columnNumber\":7,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js line 59 > eval\",\"lineNumber\":7,\"columnNumber\":31,\"functionName\":null},{\"filename\":\"resource://testing-common/content-task.js\",\"lineNumber\":60,\"columnNumber\":29,\"functionName\":null}]}",
"stacktrace": [
{
"filename": "http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html",
@ -143,13 +143,13 @@ stubPreparedMessages.set(`TypeError longString message`, new ConsoleMessage({
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],
@ -249,13 +249,13 @@ stubPackets.set(`ReferenceError: asdf is not defined`, {
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],
@ -285,13 +285,13 @@ stubPackets.set(`SyntaxError: redeclaration of let a`, {
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],
@ -341,13 +341,13 @@ stubPackets.set(`TypeError longString message`, {
{
"filename": "resource://testing-common/content-task.js line 59 > eval",
"lineNumber": 7,
"columnNumber": 9,
"columnNumber": 31,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js",
"lineNumber": 60,
"columnNumber": 20,
"columnNumber": 29,
"functionName": null
}
],

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

@ -28,7 +28,7 @@ add_task(async function testTraceMessages() {
const [, line, column] =
message.querySelector(".frame-link-line").textContent.split(":");
is(line, 20, "message frame has expected line");
is(column, 3, "message frame has expected column");
is(column, 11, "message frame has expected column");
const stack = message.querySelector(".stacktrace");
ok(!!stack, "There's a stacktrace element");

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

@ -72,7 +72,7 @@ async function testMessagesCopy(hud, timestamp) {
is(lines.length, 2, "There are 2 lines in the copied text");
is(lines[1], "", "The last line is an empty new line");
is(lines[0],
`${timestamp ? getTimestampText(message) + " " : ""}simple text message test.js:3:7`,
`${timestamp ? getTimestampText(message) + " " : ""}simple text message test.js:3:15`,
"Line of simple log message has expected text");
if (timestamp) {
ok(LOG_FORMAT_WITH_TIMESTAMP.test(lines[0]),
@ -91,7 +91,7 @@ async function testMessagesCopy(hud, timestamp) {
is(lines.length, 4, "There are 4 lines in the copied text");
is(lines[lines.length - 1], "", "The last line is an empty new line");
is(lines[0],
`${timestamp ? getTimestampText(message) + " " : ""}console.trace() test.js:6:9`,
`${timestamp ? getTimestampText(message) + " " : ""}console.trace() test.js:6:17`,
"Stacktrace first line has the expected text");
if (timestamp) {
ok(LOG_FORMAT_WITH_TIMESTAMP.test(lines[0]),

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

@ -58,7 +58,7 @@ add_task(async function() {
let lines = clipboardText.split(newLineString);
is(lines.length, 5, "Correct number of lines in the copied text");
is(lines[lines.length - 1], "", "The last line is an empty new line");
is(lines[0], `console.trace() wrapperTrace test.js:3:27`,
is(lines[0], `console.trace() wrapperTrace test.js:3:35`,
"Message first line has the expected text");
is(lines[1], ` wrapper ${TEST_URI}test.js:3`,
"Stacktrace first line has the expected text");
@ -80,7 +80,7 @@ add_task(async function() {
lines = clipboardText.split(newLineString);
is(lines.length, 7, "Correct number of lines in the copied text");
is(lines[lines.length - 1], "", "The last line is an empty new line");
is(lines[0], `console.trace() wrapperTrace test.js:3:27`,
is(lines[0], `console.trace() wrapperTrace test.js:3:35`,
"Message first line has the expected text");
is(lines[1], ` wrapper ${TEST_URI}test.js:3`,
"Stacktrace first line has the expected text");

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

@ -60,24 +60,24 @@ add_task(async function() {
// Here we should have:
// -------------------------------------------------------------------
// hello test.js:4:9
// hello test.js:4:17
// -------------------------------------------------------------------
// myObject:
// Object { a: 1 }
// myArray:
// Array [ "b", "c"]
// test.js:5:9
// test.js:5:17
// -------------------------------------------------------------------
// Error: "error object":
// wrapper test.js:5
// logStuff test.js:9
// test.js:6:9
// logStuff test.js:17
// test.js:6:17
// -------------------------------------------------------------------
// console.trace() myConsoleTrace test.js:7:9
// wrapper test.js:7
// logStuff test.js:9
// logStuff test.js:17
// -------------------------------------------------------------------
// world ! test.js:8:9
// world ! test.js:8:17
// -------------------------------------------------------------------
info("Check if all messages where copied to clipboard");
@ -86,28 +86,28 @@ add_task(async function() {
is(clipboardLines[clipboardLines.length - 1], "", "Last line is empty");
info("Check simple text message");
is(clipboardLines[0], "hello test.js:4:9", "Simple log has expected text");
is(clipboardLines[0], "hello test.js:4:17", "Simple log has expected text");
info("Check multiple logged items message");
is(clipboardLines[1], `myObject: `);
is(clipboardLines[2], `Object { a: 1 }`);
is(clipboardLines[3], ` myArray: `);
is(clipboardLines[4], `Array [ "b", "c" ]`);
is(clipboardLines[5], `test.js:5:9`);
is(clipboardLines[5], `test.js:5:17`);
info("Check logged error object");
is(clipboardLines[6], `Error: "error object"`);
is(clipboardLines[7], ` wrapper ${TEST_URI}test.js:6`);
is(clipboardLines[8], ` logStuff ${TEST_URI}test.js:10`);
is(clipboardLines[9], `test.js:6:9`);
is(clipboardLines[9], `test.js:6:17`);
info("Check console.trace message");
is(clipboardLines[10], `console.trace() myConsoleTrace test.js:7:9`);
is(clipboardLines[10], `console.trace() myConsoleTrace test.js:7:17`);
is(clipboardLines[11], ` wrapper ${TEST_URI}test.js:7`);
is(clipboardLines[12], ` logStuff ${TEST_URI}test.js:10`);
info("Check console.info message");
is(clipboardLines[13], `world ! test.js:8:9`);
is(clipboardLines[13], `world ! test.js:8:17`);
});
/**

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

@ -28,10 +28,12 @@ add_task(async function() {
await reverseStepOverToLine(client, 21);
await checkEvaluateInTopFrame(client, "number", 9);
await stepOverToLine(client, 21);
await stepOverToLine(client, 22);
await stepOverToLine(client, 23);
await stepOverToLine(client, 13);
await stepOverToLine(client, 17);
await stepOverToLine(client, 17);
await stepOverToLine(client, 18);
// After forward-stepping out of the topmost frame we should run forward to

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

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
/* Async parent frames from pushPrefEnv don't show up in e10s. */
var isE10S = !SpecialPowers.isMainProcess();
if (!isE10S && SpecialPowers.getBoolPref("javascript.options.asyncstack")) {
asyncFrame = `Async*@${file}:153:3
asyncFrame = `Async*@${file}:153:17
`;
} else {
asyncFrame = "";
@ -36,14 +36,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
is(e.name, "Error", "Should not have an interesting name here");
is(e.message, "We are an Error", "Should have the right message");
is(e.stack,
`doTest@${file}:31:7
`doTest@${file}:31:9
${asyncFrame}`,
"Exception stack should still only show our code");
is(e.fileName,
file,
"Should have the right file name");
is(e.lineNumber, 31, "Should have the right line number");
is(e.columnNumber, 7, "Should have the right column number");
is(e.columnNumber, 9, "Should have the right column number");
}
try {
@ -57,7 +57,7 @@ ${asyncFrame}`,
is(e.code, DOMException.NOT_SUPPORTED_ERR,
"Should have the right 'code'");
is(e.stack,
`doTest@${file}:50:7
`doTest@${file}:50:9
${asyncFrame}`,
"Exception stack should still only show our code");
is(e.filename,
@ -78,14 +78,14 @@ ${asyncFrame}`,
is(e.message, "We are a TypeError",
"Should also have the right message (2)");
is(e.stack,
`doTest@${file}:72:7
`doTest@${file}:72:9
${asyncFrame}`,
"Exception stack for TypeError should only show our code");
is(e.fileName,
file,
"Should still have the right file name for TypeError");
is(e.lineNumber, 72, "Should still have the right line number for TypeError");
is(e.columnNumber, 7, "Should have the right column number for TypeError");
is(e.columnNumber, 9, "Should have the right column number for TypeError");
}
try {
@ -98,15 +98,15 @@ ${asyncFrame}`,
is(e.message, "missing argument 0 when calling function Array.indexOf",
"Should also have the right message (3)");
is(e.stack,
`doTest/<@${file}:92:45
doTest@${file}:92:7
`doTest/<@${file}:92:51
doTest@${file}:92:9
${asyncFrame}`,
"Exception stack for TypeError should only show our code (3)");
is(e.fileName,
file,
"Should still have the right file name for TypeError (3)");
is(e.lineNumber, 92, "Should still have the right line number for TypeError (3)");
is(e.columnNumber, 45, "Should have the right column number for TypeError (3)");
is(e.columnNumber, 51, "Should have the right column number for TypeError (3)");
}
try {
@ -118,7 +118,7 @@ ${asyncFrame}`,
is(e.name, "NS_ERROR_UNEXPECTED", "Name should be sanitized (4)");
is(e.message, "", "Message should be sanitized (5)");
is(e.stack,
`doTest@${file}:113:7
`doTest@${file}:113:9
${asyncFrame}`,
"Exception stack for sanitized exception should only show our code (4)");
is(e.filename,
@ -137,7 +137,7 @@ ${asyncFrame}`,
is(e.name, "NS_ERROR_UNEXPECTED", "Name should be sanitized (5)");
is(e.message, "", "Message should be sanitized (5)");
is(e.stack,
`doTest@${file}:132:7
`doTest@${file}:132:9
${asyncFrame}`,
"Exception stack for sanitized exception should only show our code (5)");
is(e.filename,

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

@ -50,7 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
ensurePromiseFail.bind(null, 1),
checkExn.bind(null, 49, "InternalError", unwrapError,
undefined, ourFile, 1,
`doTest@${ourFile}:49:7
`doTest@${ourFile}:49:9
` +
parentFrame)),
t.testPromiseWithThrowingContentPromiseInit(function() {
@ -61,12 +61,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
"thereIsNoSuchContentFunction1 is not defined",
undefined, ourFile, 2,
`doTest/<@${ourFile}:57:11
doTest@${ourFile}:56:7
doTest@${ourFile}:56:9
` +
parentFrame)),
t.testPromiseWithThrowingChromeThenFunction().then(
ensurePromiseFail.bind(null, 3),
checkExn.bind(null, 0, "InternalError", unwrapError, undefined, "", 3, asyncStack ? (`Async*doTest@${ourFile}:67:7
checkExn.bind(null, 0, "InternalError", unwrapError, undefined, "", 3, asyncStack ? (`Async*doTest@${ourFile}:67:9
` +
parentFrame) : "")),
t.testPromiseWithThrowingContentThenFunction(function() {
@ -78,12 +78,12 @@ doTest@${ourFile}:56:7
undefined, ourFile, 4,
`doTest/<@${ourFile}:73:11
` +
(asyncStack ? `Async*doTest@${ourFile}:72:7
(asyncStack ? `Async*doTest@${ourFile}:72:9
` : "") +
parentFrame)),
t.testPromiseWithThrowingChromeThenable().then(
ensurePromiseFail.bind(null, 5),
checkExn.bind(null, 0, "InternalError", unwrapError, undefined, "", 5, asyncStack ? (`Async*doTest@${ourFile}:84:7
checkExn.bind(null, 0, "InternalError", unwrapError, undefined, "", 5, asyncStack ? (`Async*doTest@${ourFile}:84:9
` +
parentFrame) : "")),
t.testPromiseWithThrowingContentThenable({
@ -94,13 +94,13 @@ doTest@${ourFile}:56:7
"thereIsNoSuchContentFunction3 is not defined",
undefined, ourFile, 6,
`then@${ourFile}:90:32
` + (asyncStack ? `Async*doTest@${ourFile}:89:7\n` + parentFrame : ""))),
` + (asyncStack ? `Async*doTest@${ourFile}:89:9\n` + parentFrame : ""))),
t.testPromiseWithDOMExceptionThrowingPromiseInit().then(
ensurePromiseFail.bind(null, 7),
checkExn.bind(null, 98, "NotFoundError",
"We are a second DOMException",
DOMException.NOT_FOUND_ERR, ourFile, 7,
`doTest@${ourFile}:98:7
`doTest@${ourFile}:98:9
` +
parentFrame)),
t.testPromiseWithDOMExceptionThrowingThenFunction().then(
@ -108,7 +108,7 @@ doTest@${ourFile}:56:7
checkExn.bind(null, asyncStack ? 106 : 0, "NetworkError",
"We are a third DOMException",
DOMException.NETWORK_ERR, asyncStack ? ourFile : "", 8,
(asyncStack ? `Async*doTest@${ourFile}:106:7
(asyncStack ? `Async*doTest@${ourFile}:106:9
` +
parentFrame : ""))),
t.testPromiseWithDOMExceptionThrowingThenable().then(
@ -117,7 +117,7 @@ doTest@${ourFile}:56:7
"We are a fourth DOMException",
DOMException.TYPE_MISMATCH_ERR,
asyncStack ? ourFile : "", 9,
(asyncStack ? `Async*doTest@${ourFile}:114:7
(asyncStack ? `Async*doTest@${ourFile}:114:9
` +
parentFrame : ""))),
]).then(SimpleTest.finish,

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

@ -58,7 +58,7 @@ let testingInterface;
ok(report.body.message.includes("TestingDeprecatedInterface.deprecatedMethod"), "We have a message");
is(report.body.sourceFile, location.href, "We have a sourceFile");
is(report.body.lineNumber, 71, "We have a lineNumber");
is(report.body.columnNumber, 4, "We have a columnNumber");
is(report.body.columnNumber, 21, "We have a columnNumber");
obs.disconnect();
resolve();

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

@ -7369,41 +7369,30 @@ bool BytecodeEmitter::emitCallOrNew(
}
ParseNode* coordNode = callNode;
if (op == JSOP_CALL || op == JSOP_SPREADCALL) {
switch (calleeNode->getKind()) {
case ParseNodeKind::DotExpr: {
// Check if this member is a simple chain of simple chain of
// property accesses, e.g. x.y.z, this.x.y, super.x.y
bool simpleDotChain = false;
for (ParseNode* cur = calleeNode; cur->isKind(ParseNodeKind::DotExpr);
cur = &cur->as<PropertyAccess>().expression()) {
PropertyAccess* prop = &cur->as<PropertyAccess>();
ParseNode* left = &prop->expression();
// TODO(khyperia): Implement private field access.
if (left->isKind(ParseNodeKind::Name) ||
left->isKind(ParseNodeKind::ThisExpr) ||
left->isKind(ParseNodeKind::SuperBase)) {
simpleDotChain = true;
}
}
if (op == JSOP_CALL || op == JSOP_SPREADCALL || op == JSOP_FUNCALL ||
op == JSOP_FUNAPPLY) {
// Default to using the location of the `(` itself.
// obj[expr]() // expression
// ^ // column coord
coordNode = argsList;
if (!simpleDotChain) {
// obj().aprop() // expression
// ^ // column coord
//
// Note: Because of the constant folding logic in FoldElement,
// this case also applies for constant string properties.
//
// obj()['aprop']() // expression
// ^ // column coord
coordNode = &calleeNode->as<PropertyAccess>().key();
}
switch (calleeNode->getKind()) {
case ParseNodeKind::DotExpr:
// Use the position of a property access identifier.
//
// obj().aprop() // expression
// ^ // column coord
//
// Note: Because of the constant folding logic in FoldElement,
// this case also applies for constant string properties.
//
// obj()['aprop']() // expression
// ^ // column coord
coordNode = &calleeNode->as<PropertyAccess>().key();
break;
}
case ParseNodeKind::ElemExpr:
// obj[expr]() // expression
// ^ // column coord
coordNode = argsList;
case ParseNodeKind::Name:
// Use the start of callee names.
coordNode = calleeNode;
break;
default:
break;

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

@ -12,5 +12,5 @@ contentGlobal.eval("\n" +
// line numbers, and there's no trace of the myAPI call between the two
// evals.
assertEq(stack, "@eval line 2 > eval:1:16\n" +
"contentTest@eval:2:26\n" +
"contentTest@eval:2:33\n" +
"@eval:3:1\n");

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

@ -1,11 +1,11 @@
try {
Array.indexOf();
} catch (e) {
assertEq(e.columnNumber, 5);
assertEq(e.columnNumber, 11);
// Filter the filename from the stack, since we have no clue what
// to expect there. Search for ':' from the end, because the file
// path may contain ':' in it.
var lastColon = e.stack.lastIndexOf(':');
var afterPath = e.stack.lastIndexOf(':', lastColon - 1);
assertEq(e.stack.substring(afterPath), ":2:5\n");
assertEq(e.stack.substring(afterPath), ":2:11\n");
}

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

@ -0,0 +1 @@
|jit-test| slow

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

@ -0,0 +1 @@
|jit-test| slow

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

@ -0,0 +1 @@
|jit-test| slow

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

@ -0,0 +1 @@
|jit-test| slow

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

@ -3,8 +3,8 @@ load(libdir + "assert-offset-columns.js");
// getColumnOffsets correctly places the various parts of a ForStatement.
assertOffsetColumns(
"function f(n) { for (var i = 0; i < n; ++i) hits.push('.'); hits.push('!'); }",
" ^ ^ ^ ^ ^ ^",
"0 1 3 . 2 1 3 . 2 1 3 . 2 1 4 ! 5",
" ^ ^ ^ ^ ^ ^ ^ ^",
"0 1 3 4 . 2 1 3 4 . 2 1 3 4 . 2 1 5 6 ! 7",
);
// getColumnOffsets correctly places multiple variable declarations.
@ -89,8 +89,8 @@ assertOffsetColumns(
"var args = [];\n" +
"var obj = { base: { a(){ return { b(){} }; } } };\n" +
"function f(n) { obj.base.a().b(...args); }",
" ^ ^ ^ ^",
"0 2 1 3",
" ^ ^ ^ ^ ^",
"0 1 3 2 4",
);
// getColumnOffsets correctly places the part of normal ::Dot node with "this" root.
@ -98,8 +98,8 @@ assertOffsetColumns(
"var args = [];\n" +
"var obj = { base: { a(){ return { b(){} }; } } };\n" +
"var f = function() { this.base.a().b(...args); }.bind(obj);",
" ^ ^ ^ ^",
"0 2 1 3",
" ^ ^ ^ ^ ^",
"0 1 3 2 4",
);
// getColumnOffsets correctly places the part of normal ::Dot node with "super" base.
@ -107,8 +107,8 @@ assertOffsetColumns(
"var args = [];\n" +
"var obj = { base: { a(){ return { b(){} }; } } };\n" +
"var f = { __proto__: obj, f(n) { super.base.a().b(...args); } }.f;",
" ^ ^ ^ ^",
"0 2 1 3",
" ^ ^ ^ ^ ^",
"0 1 3 2 4",
);
// getColumnOffsets correctly places the part of normal ::Dot node with other base.
@ -126,8 +126,8 @@ assertOffsetColumns(
"var obj = { base: { a(){ return { b(){} }; } } };\n" +
// Constant folding makes the static string behave like a dot access.
"function f(n) { obj.base['a']()['b'](...args); }",
" ^ ^ ^ ^",
"0 2 1 3",
" ^ ^ ^ ^ ^",
"0 1 3 2 4",
);
// getColumnOffsets correctly places the part of computed ::Elem node.

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

@ -99,14 +99,14 @@ BEGIN_TEST(testSavedStacks_RangeBasedForLoops) {
// Stack string
const char* SpiderMonkeyStack =
"three@filename.js:4:14\n"
"two@filename.js:3:22\n"
"one@filename.js:2:20\n"
"@filename.js:1:11\n";
"two@filename.js:5:6\n"
"one@filename.js:6:4\n"
"@filename.js:7:2\n";
const char* V8Stack =
" at three (filename.js:4:14)\n"
" at two (filename.js:3:22)\n"
" at one (filename.js:2:20)\n"
" at filename.js:1:11";
" at two (filename.js:5:6)\n"
" at one (filename.js:6:4)\n"
" at filename.js:7:2";
struct {
js::StackFormat format;
const char* expected;
@ -155,9 +155,9 @@ BEGIN_TEST(testSavedStacks_ErrorStackSpiderMonkey) {
// Stack string
const char* SpiderMonkeyStack =
"three@filename.js:4:14\n"
"two@filename.js:3:22\n"
"one@filename.js:2:20\n"
"@filename.js:1:11\n";
"two@filename.js:5:6\n"
"one@filename.js:6:4\n"
"@filename.js:7:2\n";
JSLinearString* lin = stack->ensureLinear(cx);
CHECK(lin);
CHECK(js::StringEqualsAscii(lin, SpiderMonkeyStack));
@ -187,9 +187,9 @@ BEGIN_TEST(testSavedStacks_ErrorStackV8) {
const char* V8Stack =
"Error: foo\n"
" at three (filename.js:4:14)\n"
" at two (filename.js:3:22)\n"
" at one (filename.js:2:20)\n"
" at filename.js:1:11";
" at two (filename.js:5:6)\n"
" at one (filename.js:6:4)\n"
" at filename.js:7:2";
JSLinearString* lin = stack->ensureLinear(cx);
CHECK(lin);
CHECK(js::StringEqualsAscii(lin, V8Stack));

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

@ -248,16 +248,16 @@ BEGIN_TEST(test_ubiStackFrame) {
ubiFrame = ubiFrame.parent();
CHECK(checkString("two", bufferFunctionDisplayName, getFunctionDisplayName));
CHECK(ubiFrame.line() == 3);
CHECK(ubiFrame.line() == 5);
ubiFrame = ubiFrame.parent();
CHECK(checkString("one", bufferFunctionDisplayName, getFunctionDisplayName));
CHECK(ubiFrame.line() == 2);
CHECK(ubiFrame.line() == 6);
ubiFrame = ubiFrame.parent();
CHECK(ubiFrame.functionDisplayName().is<JSAtom*>());
CHECK(ubiFrame.functionDisplayName().as<JSAtom*>() == nullptr);
CHECK(ubiFrame.line() == 1);
CHECK(ubiFrame.line() == 7);
ubiFrame = ubiFrame.parent();
CHECK(!ubiFrame);

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

@ -65,8 +65,8 @@ test(function(){e += 1 }, 17);
test(function() { print[e]; }, 20);
test(function() { e[1]; }, 19);
test(function() { e(); }, 19);
test(function() { 1(); }, 19);
test(function() { Object.defineProperty() }, 19);
test(function() { 1(); }, 20);
test(function() { Object.defineProperty() }, 26);
test(function() {
// 1 2

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

@ -36,7 +36,7 @@
.then(t.step_func(e => {
assert_equals(e.blockedURI, "inline");
assert_equals(e.lineNumber, 118);
assert_equals(e.columnNumber, 4);
assert_in_array(e.columnNumber, [4, 6]);
assert_equals(e.target, document, "Elements created in this document, but pushed into a same-origin frame trigger on that frame's document, not on this frame's document.");
return watcher.wait_for('securitypolicyviolation');
}))
@ -50,7 +50,7 @@
.then(t.step_func(e => {
assert_equals(e.blockedURI, "inline");
assert_equals(e.lineNumber, 139);
assert_equals(e.columnNumber, 4);
assert_in_array(e.columnNumber, [4, 6]);
assert_equals(e.target, document, "Inline event handlers for disconnected elements target the document.");
return watcher.wait_for('securitypolicyviolation');
}))

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

@ -41,7 +41,7 @@ add_task(async function test_error_location() {
if (frame) {
equal(frame.source, fileName, "Frame source");
equal(frame.line, 6, "Frame line");
equal(frame.column, 7, "Frame column");
equal(frame.column, 23, "Frame column");
equal(frame.functionDisplayName, "background", "Frame function name");
}
});