Support multiple console arguments in sandcastle #13014
Merged
+177
−75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There's been a long standing issue that that console function wrappers we use in sandcastle do not pass along multiple arguments. This has always really frustrated me so while I was in the code for #13013 I also expanded support for this.
console.log,console.warnandconsole.errorall now pass multiple arguments out of the iframe to the console mirror[]and spaces[object Object]Errorobjects mixed in but it does break the ability to pass thelineNumberout of the iframe. I have some thoughts about how to address that when we get around to adding editor line highlighting back but for now I wanted to avoid bloating this PR even more.Overall the goal is not to perfectly match what shows in DevTools but give a "good enough" approximation that's usable for developers. I don't think it's worth the effort (right now) to implement all the logic and UI needed to explore objects and nested values and everything else that DevTools can do.
Issue number and link
Fixes #11141
Also part of #12894
Testing plan
console.log,console.warnandconsole.errorcallsAuthor checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my change