Comments (3)
I cannot reproduce: https://jsfiddle.net/bigtimebuddy/pjvrebs8/
Please provide more information or an example that minimally reproduces the problem.
from pixijs.
I conducted a new review and realized that when I add this code to my project, this issue arises. I need the functions with the same name.
Array.prototype.remove = function (item) { return this.splice(this.indexOf(item), 1) }
Array.prototype.insert = function (index) { this.splice.apply(this, [index, 0].concat(Array.prototype.slice.call(arguments, 1))); return this; }
from pixijs.
In general, adding prototype methods to global objects is not a good practice. It can lead to issues such as this, where we are doing a for-loop and it picks up these methods as enumerable. We see this sometimes with Object.prototype method because we often enumerate through the keys. The best solution is to create utility methods (e.g., ArrayUtils.remove(arr, item)
). If you are going to add prototype chain methods, make sure they are not enumerable like this:
Object.defineProperties(Array.prototype, {
remove: {
enumerable: false,
get(item) {
return this.splice(this.indexOf(item), 1);
}
}
});
from pixijs.
Related Issues (20)
- Bug: `filterArea` only works if it is set before `filters` HOT 2
- Bug: v8.1.0:Strange bug, video cannot be controlled
- Bug: new Sprite gives me an error because the texture is not passed HOT 1
- Bug: Memory Leak / Inappropriate cleanUp - stage.renderGroup cleanUp is not there HOT 3
- Bug: Text displays as white or black rectangle on iOS 12 & 13 HOT 3
- Feature Request: PIXI.Texture.fromBuffer HOT 2
- Bug: MAX_TEXTURES constant HOT 2
- Bug: `maxRecommendedTextures` ignores the current context (DOM vs worker) HOT 2
- Bug: Redrawing `Graphics` leaks memory HOT 2
- Bug: `Graphics.clear()` doesn't clear active path
- Bug: Importing basis pollute the console
- Bug: Update Matrix uniforms crashes V8 HOT 5
- Bug: WebGPURenderer: TypeError: Cannot read properties of null (reading 'features') with NW.js v.0.86 HOT 1
- Feature Request: Creating a texture with rgba signed integer format HOT 1
- Bug: 8.1.4 break text HOT 4
- Bug: When alignment=0 or 1, the stroke is incorrect
- Bug: Point missing Vector2 math HOT 1
- Bug: Property 'name' does not exist on type 'Container'. HOT 2
- Bug: When using anchor of 0.5 for Text, interaction hitbox is 50% size (_bounds still correct)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixijs.