Browse Source

More robust polyfill for Function.prototype.name. See #10071.

Mr.doob 8 years ago
parent
commit
9b9256a96d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/polyfills.js

+ 1 - 1
src/polyfills.js

@@ -29,7 +29,7 @@ if ( Function.prototype.name === undefined ) {
 
 		get: function () {
 
-			return this.toString().match( /^\s*function\s*(\S*)\s*\(/ )[ 1 ];
+			return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ];
 
 		}