ITADN

[p5.js 2.0+ Bug Report]: Some Vector friendly errors don't work correctly

#8930Opensidwellr 创建于 2026-06-16
BugArea:Mathp5.js 2.0+Reserved (CodeDay)
S
sidwellrcommented
### Most appropriate sub-area of p5.js? - [ ] Accessibility - [ ] Color - [ ] Core/Environment/Rendering - [ ] Data - [ ] DOM - [ ] Events - [ ] Image - [ ] IO - [x] Math - [ ] Typography - [ ] Utilities - [ ] WebGL - [ ] WebGPU - [ ] p5.strands - [ ] Build process - [ ] Unit testing - [ ] Internationalization - [ ] Friendly errors - [ ] Other (specify if possible) ### p5.js version 2.3.0 ### Web browser and version Brave 1.90.122 ### Operating system Linux Mint 22.1 ### Steps to reproduce this ### Steps: 1. Run the snippet below. It has an error; the first param should be a vector. 2. The expected output is a friendly error message "The v1 parameter should be of type Array or p5.Vector" 3. Instead, it gives an error "TypeError: this._friendlyError is not a function" ### Snippet: ```js function setup() { print(p5.Vector.equals(1, createVector(1, 2))); } ``` ### Discussion Friendly errors for vectors seem to work fine for instance methods like `setValue()`, but not for static methods like `p5.Vector.equals`.
2 条评论