ad21d212fc
This changes the logic for generating method names in `error.stack` to prepend an inferred type name only when the function name is a valid ECMAScript identifiers and does not equal the inferred type name, to (1) give developers more control over the exact name shown in `error.stack`, as well as (2) avoid confusion in the presence of renaming of local variables. Previously we'd leave the function name as-is if it was prefixed by the inferred type name, but that condition is unnecessarily strict, and led to a bunch of inconsistencies around special names like `<instance_member_initializer>` where this dynamic approached often prefixed it with the correct type name, but also sometimes got it wrong and prepended `Object.`, which is very unfortunate and misleading. Specifically for these special names, we'll add logic later in the parser to infer a useful (complete) name. The design doc (https://bit.ly/devtools-method-names-in-stack-traces) contains more background and examples of why we do this change. Doc: https://bit.ly/devtools-method-names-in-stack-traces Fixed: chromium:1294619 Bug: chromium:1283435 Change-Id: Ib8b528ba25255dcd07e9d11044c562c11d699bcb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3565724 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/main@{#79748} |
||
---|---|---|
.. | ||
fail | ||
mjsunit | ||
regress/fail | ||
asm-assignment-undeclared.js | ||
asm-assignment-undeclared.out | ||
asm-function-mismatch-def.js | ||
asm-function-mismatch-def.out | ||
asm-function-mismatch-use.js | ||
asm-function-mismatch-use.out | ||
asm-function-redefined.js | ||
asm-function-redefined.out | ||
asm-function-undefined.js | ||
asm-function-undefined.out | ||
asm-function-variable-collision.js | ||
asm-function-variable-collision.out | ||
asm-import-wrong-annotation.js | ||
asm-import-wrong-annotation.out | ||
asm-import-wrong-object.js | ||
asm-import-wrong-object.out | ||
asm-linking-bogus-heap.js | ||
asm-linking-bogus-heap.out | ||
asm-linking-bogus-stdlib.js | ||
asm-linking-bogus-stdlib.out | ||
asm-linking-missing-heap.js | ||
asm-linking-missing-heap.out | ||
asm-missing-parameter-annotation.js | ||
asm-missing-parameter-annotation.out | ||
asm-missing-return-annotation.js | ||
asm-missing-return-annotation.out | ||
asm-table-mismatch-def.js | ||
asm-table-mismatch-def.out | ||
asm-table-mismatch-use.js | ||
asm-table-mismatch-use.out | ||
asm-table-redefined.js | ||
asm-table-redefined.out | ||
asm-table-undefined.js | ||
asm-table-undefined.out | ||
asm-table-variable-collision.js | ||
asm-table-variable-collision.out | ||
BUILD.gn | ||
empty.js | ||
empty.out | ||
message.status | ||
non-use-strict-hex-escape.js | ||
non-use-strict-hex-escape.out | ||
non-use-strict-octal-escape.js | ||
non-use-strict-octal-escape.out | ||
non-use-strict-uhex-escape.js | ||
non-use-strict-uhex-escape.out | ||
nonstrict-arguments.js | ||
nonstrict-arguments.out | ||
nonstrict-eval.js | ||
nonstrict-eval.out | ||
nonstrict-with.js | ||
nonstrict-with.out | ||
object-binding-pattern-await-computed-name.js | ||
object-binding-pattern-await-computed-name.out | ||
README.md | ||
strict-octal-indirect-regexp.js | ||
strict-octal-indirect-regexp.out | ||
strict-octal-regexp.js | ||
strict-octal-regexp.out | ||
testcfg.py | ||
try-catch-finally-no-message.js | ||
try-catch-finally-no-message.out | ||
try-catch-finally-return-in-finally.js | ||
try-catch-finally-return-in-finally.out | ||
try-finally-return-in-finally.js | ||
try-finally-return-in-finally.out | ||
wasm-finish-compilation.js | ||
wasm-finish-compilation.out | ||
wasm-function-name-async.js | ||
wasm-function-name-async.out | ||
wasm-function-name-streaming.js | ||
wasm-function-name-streaming.out | ||
wasm-module-and-function-name-async.js | ||
wasm-module-and-function-name-async.out | ||
wasm-module-and-function-name-streaming.js | ||
wasm-module-and-function-name-streaming.out | ||
wasm-module-name-async.js | ||
wasm-module-name-async.out | ||
wasm-module-name-streaming.js | ||
wasm-module-name-streaming.out | ||
wasm-no-name-async.js | ||
wasm-no-name-async.out | ||
wasm-no-name-streaming.js | ||
wasm-no-name-streaming.out | ||
wasm-trace-liftoff.js | ||
wasm-trace-liftoff.out | ||
wasm-trace-memory-liftoff.js | ||
wasm-trace-memory-liftoff.out | ||
wasm-trace-memory.js | ||
wasm-trace-memory.out | ||
wasm-trace-turbofan.js | ||
wasm-trace-turbofan.out | ||
weakref-finalizationregistry-error.js | ||
weakref-finalizationregistry-error.out |
JavaScript tests with expected output
Tests in test/message
pass if the output matches the expected output.
Message tests are particularly useful when checking for exact error messages.
Tests and their expected output must have the same filename, with the .js
and
.out
extension.
foo.js
foo.out
You can use a regex in the expected output instead of the exact path:
*%(basename)s:7: SyntaxError: Detected cycle while resolving name 'a'
Empty lines are ignored in the comparison, but whitespaces are not.
Exact details of the test runner are in testcfg.py.