Skip to content

Commit

Permalink
fix: Use [ and ] instead of ( and ) for debug transform (#68142)
Browse files Browse the repository at this point in the history
### What?

Use `[]` instead of `()` for call stack.

### Why?

#68056 (comment)

### How?
  • Loading branch information
kdy1 authored Jul 25, 2024
1 parent d4eb89d commit 29c23b2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl VisitMut for DebugFnName {
if !self.path.is_empty() {
self.path.push('.');
}
let _ = write!(self.path, "{target}({name})");
let _ = write!(self.path, "{target}[{name}]");

n.visit_mut_children_with(self);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const Component = ()=>{
"Component.useEffect": ()=>{}
}["Component.useEffect"]);
const onClick = useCallback({
"Component.useCallback(onClick)": ()=>[]
}["Component.useCallback(onClick)"]);
"Component.useCallback[onClick]": ()=>[]
}["Component.useCallback[onClick]"]);
const computed = useMemo({
"Component.useMemo(computed)": ()=>{}
}["Component.useMemo(computed)"]);
"Component.useMemo[computed]": ()=>{}
}["Component.useMemo[computed]"]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function useSomething() {
"useSomething.useEffect": ()=>{}
}["useSomething.useEffect"]);
const onClick = useCallback({
"useSomething.useCallback(onClick)": ()=>[]
}["useSomething.useCallback(onClick)"]);
"useSomething.useCallback[onClick]": ()=>[]
}["useSomething.useCallback[onClick]"]);
const computed = useMemo({
"useSomething.useMemo(computed)": ()=>{}
}["useSomething.useMemo(computed)"]);
"useSomething.useMemo[computed]": ()=>{}
}["useSomething.useMemo[computed]"]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default (()=>{
"useEffect": ()=>{}
}["useEffect"]);
const onClick = useCallback({
"useCallback(onClick)": ()=>[]
}["useCallback(onClick)"]);
"useCallback[onClick]": ()=>[]
}["useCallback[onClick]"]);
const computed = useMemo({
"useMemo(computed)": ()=>{}
}["useMemo(computed)"]);
"useMemo[computed]": ()=>{}
}["useMemo[computed]"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const Component = someHoC(()=>{
"Component.useEffect": ()=>{}
}["Component.useEffect"]);
const onClick = useCallback({
"Component.useCallback(onClick)": ()=>[]
}["Component.useCallback(onClick)"]);
"Component.useCallback[onClick]": ()=>[]
}["Component.useCallback[onClick]"]);
const computed = useMemo({
"Component.useMemo(computed)": ()=>{}
}["Component.useMemo(computed)"]);
"Component.useMemo[computed]": ()=>{}
}["Component.useMemo[computed]"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function MyComponent() {
"MyComponent.useEffect": ()=>{}
}["MyComponent.useEffect"]);
const onClick = useCallback({
"MyComponent.useCallback(onClick)": ()=>[]
}["MyComponent.useCallback(onClick)"]);
"MyComponent.useCallback[onClick]": ()=>[]
}["MyComponent.useCallback[onClick]"]);
const computed = useMemo({
"MyComponent.useMemo(computed)": ()=>{}
}["MyComponent.useMemo(computed)"]);
"MyComponent.useMemo[computed]": ()=>{}
}["MyComponent.useMemo[computed]"]);
}

0 comments on commit 29c23b2

Please sign in to comment.