Skip to content

fix(shims): fix parsing in Function.name in the IE shim - #7864

Closed
johan13 wants to merge 1 commit into
angular:masterfrom
johan13:fix-ie-name-shim
Closed

johan13 wants to merge 1 commit into
angular:masterfrom
johan13:fix-ie-name-shim

Conversation

@johan13

@johan13 johan13 commented Apr 1, 2016

Copy link
Copy Markdown

This PR fixes a bug in the Function.prototype.name shim in shims_for_IE.js.

Without this fix, given a function: function GetAnswer(){return(42);} the value returned by GetAnswer.name is GetAnswer(){return instead of GetAnswer. This breaks some minified scripts, e.g. ng2-bootstrap's Typeahead component.

The new regular expression is copied from the accepted answer to the Stack Overflow question that is mentioned in the source code. The previous regex is from the runner up answer.

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@valorkin

valorkin commented Apr 1, 2016

Copy link
Copy Markdown
Contributor

@johan13 thank you!

@ericmartinezr

Copy link
Copy Markdown
Contributor

There's another PR for this if you want to check it out #6944

Fix a bug where the Function.prototyp.name shim would return trailing
characters for minified functions.
@johan13

johan13 commented Apr 11, 2016

Copy link
Copy Markdown
Author

What is the status of this PR? Is there something that needs to be improved in order for it to be accepted?
It would fix #6501 and valor-software/ngx-bootstrap#333.

@mhevery

mhevery commented May 20, 2016

Copy link
Copy Markdown
Contributor

Closing as duplicate of #6944.

@mhevery mhevery closed this May 20, 2016
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants