Skip to content

Commit e2fc4b3

Browse files
authored
Merge pull request #7967 from limzykenneth/fes-granular
Individual flags to disable part of FES by the user
2 parents 5d56030 + ac85b7e commit e2fc4b3

File tree

4 files changed

+12
-1195
lines changed

4 files changed

+12
-1195
lines changed

src/core/friendly_errors/param_validator.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,17 @@ function validateParams(p5, fn, lifecycles) {
562562
lifecycles.presetup = function(){
563563
loadP5Constructors();
564564

565-
const excludes = ['validate'];
566-
for(const f in this){
567-
if(!excludes.includes(f) && !f.startsWith('_') && typeof this[f] === 'function'){
568-
const copy = this[f];
569-
570-
this[f] = function(...args) {
571-
this.validate(f, args);
572-
return copy.call(this, ...args);
573-
};
565+
if(p5.disableParameterValidator !== true){
566+
const excludes = ['validate'];
567+
for(const f in this){
568+
if(!excludes.includes(f) && !f.startsWith('_') && typeof this[f] === 'function'){
569+
const copy = this[f];
570+
571+
this[f] = function(...args) {
572+
this.validate(f, args);
573+
return copy.call(this, ...args);
574+
};
575+
}
574576
}
575577
}
576578
};

0 commit comments

Comments
 (0)