File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ function fesCore(p5, fn){
348348 // actual name with correct capitalization doesnt exist in context,
349349 // and if the user-defined symbol is of the type function
350350 if (
351- fxns [ lowercase ] &&
351+ fxns . hasOwnProperty ( lowercase ) &&
352352 ! context [ fxns [ lowercase ] ] &&
353353 typeof context [ prop ] === 'function'
354354 ) {
Original file line number Diff line number Diff line change @@ -137,10 +137,11 @@ class p5 {
137137 bindGlobal ( p ) ;
138138 }
139139
140+ const protectedProperties = [ 'constructor' , 'length' ] ;
140141 // Attach its properties to the window
141142 for ( const p in this ) {
142143 if ( this . hasOwnProperty ( p ) ) {
143- if ( p [ 0 ] === '_' ) continue ;
144+ if ( p [ 0 ] === '_' || protectedProperties . includes ( p ) ) continue ;
144145 bindGlobal ( p ) ;
145146 }
146147 }
You can’t perform that action at this time.
0 commit comments