Auto merge of #96428 - GuillaumeGomez:rollup-4noqr33, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #94022 (Clarify that `Cow::into_owned` returns owned data) - #94703 (Fix codegen bug in "ptx-kernel" abi related to arg passing) - #95949 (Implement Default for AssertUnwindSafe) - #96361 (Switch JS code to ES6) - #96372 (Suggest calling method on nested field when struct is missing method) - #96386 (simplify `describe_field` func in borrowck's diagnostics part) - #96400 (Correct documentation for `Rvalue::ShallowInitBox`) - #96415 (Remove references to git.io) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
082e4ca497
21 changed files with 721 additions and 284 deletions
|
|
@ -85,8 +85,11 @@ function extractFunction(content, functionName) {
|
|||
}
|
||||
|
||||
// Stupid function extractor for array.
|
||||
function extractArrayVariable(content, arrayName) {
|
||||
var splitter = "var " + arrayName;
|
||||
function extractArrayVariable(content, arrayName, kind) {
|
||||
if (typeof kind === "undefined") {
|
||||
kind = "let ";
|
||||
}
|
||||
var splitter = kind + arrayName;
|
||||
while (true) {
|
||||
var start = content.indexOf(splitter);
|
||||
if (start === -1) {
|
||||
|
|
@ -126,12 +129,18 @@ function extractArrayVariable(content, arrayName) {
|
|||
}
|
||||
content = content.slice(start + 1);
|
||||
}
|
||||
if (kind === "let ") {
|
||||
return extractArrayVariable(content, arrayName, "const ");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Stupid function extractor for variable.
|
||||
function extractVariable(content, varName) {
|
||||
var splitter = "var " + varName;
|
||||
function extractVariable(content, varName, kind) {
|
||||
if (typeof kind === "undefined") {
|
||||
kind = "let ";
|
||||
}
|
||||
var splitter = kind + varName;
|
||||
while (true) {
|
||||
var start = content.indexOf(splitter);
|
||||
if (start === -1) {
|
||||
|
|
@ -162,6 +171,9 @@ function extractVariable(content, varName) {
|
|||
}
|
||||
content = content.slice(start + 1);
|
||||
}
|
||||
if (kind === "let ") {
|
||||
return extractVariable(content, varName, "const ");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue