mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Adopt Function#name regular expression to accommodate different scenarios of white-spaces.
This commit is contained in:
parent
7a2f577b75
commit
f8c36b8276
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
|||
if (!(function f() {}).name) {
|
||||
Base.define(Function.prototype, 'name', {
|
||||
get: function() {
|
||||
return this.toString().match(/^function\s?(\w*)\(/)[1];
|
||||
return this.toString().match(/^function\s*(\w*)\s*\(/)[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue