@@ -315,41 +315,43 @@ p5.prototype._normalizeArcAngles = (
315315 */
316316p5 . prototype . arc = function ( x , y , w , h , start , stop , mode , detail ) {
317317 p5 . _validateParameters ( 'arc' , arguments ) ;
318+ // Skip validation when Friendly Errors are disabled
319+ if ( p5 . disableFriendlyErrors || typeof IS_MINIFIED !== 'undefined' ) {
320+ // Validate that numeric parameters are finite numbers
321+ if ( ! Number . isFinite ( x ) ) {
322+ console . warn ( 'arc(): x parameter should be a finite number. Received: ' + x ) ;
323+ return this ;
324+ }
325+ if ( ! Number . isFinite ( y ) ) {
326+ console . warn ( 'arc(): y parameter should be a finite number. Received: ' + y ) ;
327+ return this ;
328+ }
329+ if ( ! Number . isFinite ( w ) ) {
330+ console . warn ( 'arc(): w parameter should be a finite number. Received: ' + w ) ;
331+ return this ;
332+ }
333+ if ( ! Number . isFinite ( h ) ) {
334+ console . warn ( 'arc(): h parameter should be a finite number. Received: ' + h ) ;
335+ return this ;
336+ }
337+ if ( ! Number . isFinite ( start ) ) {
338+ console . warn ( 'arc(): start angle should be a finite number. Received: ' + start ) ;
339+ return this ;
340+ }
341+ if ( ! Number . isFinite ( stop ) ) {
342+ console . warn ( 'arc(): stop angle should be a finite number. Received: ' + stop ) ;
343+ return this ;
344+ }
318345
319- // Validate that numeric parameters are finite numbers
320- if ( ! Number . isFinite ( x ) ) {
321- console . warn ( 'arc(): x parameter should be a finite number. Received: ' + x ) ;
322- return this ;
323- }
324- if ( ! Number . isFinite ( y ) ) {
325- console . warn ( 'arc(): y parameter should be a finite number. Received: ' + y ) ;
326- return this ;
327- }
328- if ( ! Number . isFinite ( w ) ) {
329- console . warn ( 'arc(): w parameter should be a finite number. Received: ' + w ) ;
330- return this ;
331- }
332- if ( ! Number . isFinite ( h ) ) {
333- console . warn ( 'arc(): h parameter should be a finite number. Received: ' + h ) ;
334- return this ;
335- }
336- if ( ! Number . isFinite ( start ) ) {
337- console . warn ( 'arc(): start angle should be a finite number. Received: ' + start ) ;
338- return this ;
339- }
340- if ( ! Number . isFinite ( stop ) ) {
341- console . warn ( 'arc(): stop angle should be a finite number. Received: ' + stop ) ;
342- return this ;
343- }
344-
345- // Validate that width and height are positive
346- if ( w <= 0 ) {
347- console . warn ( 'arc(): width (w) should be a positive number. Received: ' + w ) ;
348- return this ;
349- }
350- if ( h <= 0 ) {
351- console . warn ( 'arc(): height (h) should be a positive number. Received: ' + h ) ;
352- return this ;
346+ // Validate that width and height are positive
347+ if ( w <= 0 ) {
348+ console . warn ( 'arc(): width (w) should be a positive number. Received: ' + w ) ;
349+ return this ;
350+ }
351+ if ( h <= 0 ) {
352+ console . warn ( 'arc(): height (h) should be a positive number. Received: ' + h ) ;
353+ return this ;
354+ }
353355 }
354356
355357 // if the current stroke and fill settings wouldn't result in something
0 commit comments