@@ -106,17 +106,19 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
106106 }
107107
108108 if ( __DEV__ ) {
109- if ( typeof arguments [ 1 ] === 'function' ) {
109+ // using a reference to `arguments` bails out of GCC optimizations which affect function arity
110+ const args = arguments ;
111+ if ( typeof args [ 1 ] === 'function' ) {
110112 console . error (
111113 'does not support the second callback argument. ' +
112114 'To execute a side effect after rendering, declare it in a component body with useEffect().' ,
113115 ) ;
114- } else if ( isValidContainer ( arguments [ 1 ] ) ) {
116+ } else if ( isValidContainer ( args [ 1 ] ) ) {
115117 console . error (
116118 'You passed a container to the second argument of root.render(...). ' +
117119 "You don't need to pass it again since you already passed it to create the root." ,
118120 ) ;
119- } else if ( typeof arguments [ 1 ] !== 'undefined' ) {
121+ } else if ( typeof args [ 1 ] !== 'undefined' ) {
120122 console . error (
121123 'You passed a second argument to root.render(...) but it only accepts ' +
122124 'one argument.' ,
@@ -131,7 +133,9 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount =
131133 // $FlowFixMe[missing-this-annot]
132134 function ( ) : void {
133135 if ( __DEV__ ) {
134- if ( typeof arguments [ 0 ] === 'function' ) {
136+ // using a reference to `arguments` bails out of GCC optimizations which affect function arity
137+ const args = arguments ;
138+ if ( typeof args [ 0 ] === 'function' ) {
135139 console . error (
136140 'does not support a callback argument. ' +
137141 'To execute a side effect after rendering, declare it in a component body with useEffect().' ,
0 commit comments