-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathfunction.polyfill.js
More file actions
27 lines (24 loc) · 845 Bytes
/
function.polyfill.js
File metadata and controls
27 lines (24 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
/**
* Function.prototype.displayName
* version 0.0.0
* Feature Chrome Firefox Internet Explorer Opera Safari Edge
* Basic support No 13 No No No No
* -------------------------------------------------------------------------------
*/
/**
* Function.prototype.name
* Feature Chrome Firefox Internet Explorer Opera Safari Edge
* Basic support 15 1 No 10.5 6 14
* ------------------------------------------------------------------------
*/
if (Function.prototype.name !== "") {
var rx = /function\ ([\w$]+)\(/;
Object.defineProperty(Function.prototype, "name", {
get: function () {
var match = rx.exec(this + "");
return match && match.length === 2 ? match[1] : "";
},
configurable: true,
});
}