Open GoToLoop opened 8 years ago
"pacman.js" can't mix up w/ other scripts which rely on for...in or Object.keys() but don't check for hasOwnProperty().
for...in
Any inclusions for built-in native objects should be accompanied by Object.defineProperty() and have its new method set to { enumerable: false }!
{ enumerable: false }
Here's the forum thread which has inspired this fix: :D https://forum.Processing.org/two/discussion/13501/p5-js-crash-when-including-a-new-js-file-packman-js-in-the-same-html-file
You're a legend. +1 for including this in the repo
"pacman.js" can't mix up w/ other scripts which rely on
for...in
or Object.keys() but don't check for hasOwnProperty().Any inclusions for built-in native objects should be accompanied by Object.defineProperty() and have its new method set to
{ enumerable: false }
!Here's the forum thread which has inspired this fix: :D https://forum.Processing.org/two/discussion/13501/p5-js-crash-when-including-a-new-js-file-packman-js-in-the-same-html-file