Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($parse): mark empty expressions as constants and literals #7762

Closed
wants to merge 1 commit into from

Conversation

rodyhaddad
Copy link
Contributor

In response of #1405 (comment)

I decided to mark it as a literal because $parse('undefined') is a literal.

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7762)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@@ -989,7 +989,7 @@ function getterFn(path, options, fullExp) {
* service.
*/
function $ParseProvider() {
var cache = {};
var cache = {'': extend(function () {}, {literal: true, constant: true})};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to add an extra code path in the Parser, that will be checked every time an expression is being parsed, so I decided to put it straight in the cache

@rodyhaddad rodyhaddad added this to the Backlog milestone Jun 9, 2014
@rodyhaddad rodyhaddad assigned rodyhaddad and unassigned rodyhaddad Jun 9, 2014
@btford btford removed the gh: PR label Aug 20, 2014
@jeffbcross jeffbcross force-pushed the master branch 2 times, most recently from cad9560 to f294244 Compare October 2, 2014 22:09
@jeffbcross jeffbcross force-pushed the master branch 4 times, most recently from e8dc429 to e83fab9 Compare October 10, 2014 17:37
lgalfaso added a commit to lgalfaso/angular.js that referenced this pull request Jan 4, 2015
Mark empty expressions as `constant` and `literal`

Closes #angular#7762
@lgalfaso
Copy link
Contributor

lgalfaso commented Jan 6, 2015

closing in favor of #10592

@lgalfaso lgalfaso closed this Jan 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants