2
0
Эх сурвалжийг харах

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

Mr.doob 9 жил өмнө
parent
commit
9b9256a96d
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  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 ];
 
 		}