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

fix(): allow spaces around dots for identifiers #8550

Closed

Conversation

pkozlowski-opensource
Copy link
Member

Fixes #4613

@pkozlowski-opensource
Copy link
Member Author

This is definitively a corner case and I'm not sure we want to support this but was looking into parser's code and saw #4613 so get a quick stab at it. For me we can just decide not to merge this one and close #4613 as won't fix. At the same time looks like someone bumped into this scenario and cared enough to open an issue...

Anyway, it is here....

@@ -263,15 +263,17 @@ Lexer.prototype = {
var ident = '';
var start = this.index;

var lastDot, peekIndex, methodName, ch;
var lastDot, justSeenADot, peekIndex, methodName, ch;
Copy link

Choose a reason for hiding this comment

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

Totally minor thing, but grammatically this would be: justSawADot

pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this pull request Aug 10, 2014
@pkozlowski-opensource
Copy link
Member Author

Thnx @lord2800 for the heads up, updated.

ident += ch;
} else {
break;
if (!(this.isWhitespace(ch) && justSawADot)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

else if (!(this.isWhitespace(ch) && justSawADot)) {
  break;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, right. Changing, thnx!

@caitp
Copy link
Contributor

caitp commented Aug 10, 2014

looks okay to me. I'm not sure if we want to support that, but I don't see an issue with being a tiny bit more flexible there.

@pkozlowski-opensource
Copy link
Member Author

@caitp I was digging into other $parse-related issues and I think I've got a different fix that also closes #4912 so closing this one in favour of #8559.

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.

Spaces around '.' in expressions handled inconsistently
4 participants