Majeed Siddiqui Posted August 26, 2016 Share Posted August 26, 2016 BabylonJS's Tag module uses https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.tags.js#L63 for (var i in arr) { ... } looping style, this gives error when we add custom methods to array prototype as follows Array.prototype.sayCheese = function () { console.log("Cheese!!"); } // with above sayCheese added var arr[] = ['majeed', 'found', 'a', 'bug']; for (var i in arr) { console.log(arr[i]); } // output: // majeed // found // a // bug // function Array.prototype.sayCheese() {} [not string a function object] Which result in i.trim is not a function exception in Tags._AddTagTo function https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.tags.js#L68. Solution: use for (var i = 0, len = arr.length; i < len; ++i) traditional loop (http://stackoverflow.com/questions/5349425/whats-the-fastest-way-to-loop-through-an-array-in-javascript) I want to contribute. Is there contribution guide or should I just make changes and make a pull request? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 26, 2016 Share Posted August 26, 2016 Excellent! I love seeing more contributors There is no contribution guide per se. Just create a PR (of the TS version only) and submit it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.