Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteac15d9

Browse files
authored
Merge pull request#7765 from HughJacks/fix-fes-error
Fixed Error in FES prevents message from being shown, Prevented 'window' properties from being overwritten
2 parents4ca88f3 +a5f0be6 commiteac15d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎src/core/friendly_errors/fes_core.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
typeofcontext[prop]==='function'
354354
){

‎src/core/main.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ class p5 {
137137
bindGlobal(p);
138138
}
139139

140+
constprotectedProperties=['constructor','length'];
140141
// Attach its properties to the window
141142
for(constpinthis){
142143
if(this.hasOwnProperty(p)){
143-
if(p[0]==='_')continue;
144+
if(p[0]==='_'||protectedProperties.includes(p))continue;
144145
bindGlobal(p);
145146
}
146147
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp