UNPKG

359 BJavaScriptView Raw
1
2// Fix Function#name on browsers that do not support it (IE):
3if (!(function f() {}).name) {
4 Object.defineProperty(Function.prototype, 'name', {
5 get: function() {
6 var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
7 Object.defineProperty(this, 'name', {value:name})
8 return name
9 }
10 });
11}