Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function.name not defined in IE #301

Closed
remojansen opened this issue Jul 24, 2016 · 1 comment
Closed

Function.name not defined in IE #301

remojansen opened this issue Jul 24, 2016 · 1 comment

Comments

@remojansen
Copy link
Member

remojansen commented Jul 24, 2016

This issue was reported by @endel on Gitter.

The issues in IE are caused because Function.name is not an standard in JS versions < ES6.

The issue takes place here.

The good news is that function name is only used to provide developer-friendly errors and it will be fine to use the following:

function getFunctionName(f: any) {
    return f.name ?  f.name : f.toString().match(/^function\s*([^\s(]+)/)[1];
}

We can add the above function to the Planner class as a private method and invoke the function here:

let constructorName = getFunctionName(func);
@mfrachet mfrachet mentioned this issue Jul 25, 2016
11 tasks
remojansen pushed a commit that referenced this issue Jul 25, 2016
Thanks a lot for the PR 👍
@remojansen
Copy link
Member Author

Done by #302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant