You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using THREE in an Aurelia-CLI project. It means it is loaded using modules and RequireJS. It works all fine except in Internet Explorer (tested in IE 11).
The code that breaks is the following (in the polyfill section at the top, lines 42-57) in the /build/three.js file
if(Function.prototype.name===undefined){// Missing in IE// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/nameObject.defineProperty(Function.prototype,'name',{get: function(){returnthis.toString().match(/^\s*function\s*([^\(\s]*)/)[1];}});}
It returns the can't redefine non-configurable property "name" error.
Following this post I've tried to replace the code above with:
if(!(functionf(){}).name){Object.defineProperty(Function.prototype,'name',{get: function(){varname=(this.toString().match(/^function\s*([^\s(]+)/)||[])[1];// For better performance only parse once, and then cache the// result through a new accessor for repeated access.Object.defineProperty(this,'name',{value: name});returnname;}});}
And it fixes the problem !
=> It seems that the polyfill code currently used in /build/three.js doesn't work well. Is it possible to replace this code for future builds ?
Three.js version
Dev
r87
...
Browser
All of them
Chrome
Firefox
Internet Explorer
OS
All of them
Windows
macOS
Linux
Android
iOS
The text was updated successfully, but these errors were encountered:
Description of the problem
I'm using THREE in an Aurelia-CLI project. It means it is loaded using modules and RequireJS. It works all fine except in Internet Explorer (tested in IE 11).
The code that breaks is the following (in the polyfill section at the top, lines 42-57) in the /build/three.js file
It returns the
can't redefine non-configurable property "name"
error.Following this post I've tried to replace the code above with:
And it fixes the problem !
=> It seems that the polyfill code currently used in /build/three.js doesn't work well. Is it possible to replace this code for future builds ?
Three.js version
Browser
OS
The text was updated successfully, but these errors were encountered: