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){
348
348
// actual name with correct capitalization doesnt exist in context,
349
349
// and if the user-defined symbol is of the type function
350
350
if (
351
- fxns [ lowercase ] &&
351
+ fxns . hasOwnProperty ( lowercase ) &&
352
352
! context [ fxns [ lowercase ] ] &&
353
353
typeof context [ prop ] === 'function'
354
354
) {
Original file line number Diff line number Diff line change @@ -137,10 +137,11 @@ class p5 {
137
137
bindGlobal ( p ) ;
138
138
}
139
139
140
+ const protectedProperties = [ 'constructor' , 'length' ] ;
140
141
// Attach its properties to the window
141
142
for ( const p in this ) {
142
143
if ( this . hasOwnProperty ( p ) ) {
143
- if ( p [ 0 ] === '_' ) continue ;
144
+ if ( p [ 0 ] === '_' || protectedProperties . includes ( p ) ) continue ;
144
145
bindGlobal ( p ) ;
145
146
}
146
147
}
You can’t perform that action at this time.
0 commit comments