Skip to content

Commit

Permalink
use a function expression to access arguments binding (#43987)
Browse files Browse the repository at this point in the history
arrow function was trying to use arguments binding but wanted arguments
of the lambda not the nearest normal function. The narrowest change is
to convert to function expression. We could also use varargs rest syntax
since this runs in runtimes that should all support that I think. I
don't think it really matters though.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
  • Loading branch information
gnoff committed Dec 12, 2022
1 parent 93fd9d3 commit 448af97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/server/app-render.tsx
Expand Up @@ -52,7 +52,7 @@ const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'
function preloadComponent(Component: any, props: any) {
const prev = console.error
// Hide invalid hook call warning when calling component
console.error = (msg) => {
console.error = function (msg) {
if (msg.startsWith('Invalid hook call..')) {
// ignore
} else {
Expand Down

0 comments on commit 448af97

Please sign in to comment.