mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
parent
18383875eb
commit
2e565dcfce
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,15 @@
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// First check if Function#name works, and if not, fix it by injecting a getter
|
||||||
|
if (!(function f() {}).name) {
|
||||||
|
Base.define(Function.prototype, 'name', {
|
||||||
|
get: function() {
|
||||||
|
return this.toString().match(/^function\s?(\w*)\(/)[1];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Base
|
* @name Base
|
||||||
* @class
|
* @class
|
||||||
|
|
Loading…
Reference in a new issue