Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

fix(dynamic_parser): Handle reserved words correctly. #614

Closed
wants to merge 4 commits into from
Closed

fix(dynamic_parser): Handle reserved words correctly. #614

wants to merge 4 commits into from

Conversation

kasperl
Copy link
Contributor

@kasperl kasperl commented Feb 25, 2014

Make sure the dynamic parser deals with reserved words correctly and in a way that's consistent with how they behave when using code generation.

@kasperl kasperl added cla: yes and removed cla: no labels Feb 25, 2014
@@ -78,3 +78,43 @@ relaxFnArgs(Function fn) {
}

capitalize(String s) => s.substring(0, 1).toUpperCase() + s.substring(1);


/// Returns whether or not the given identifier is a reserved word in Dart.
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly include the URL that was given in reserved_dart_keywords.dart, namely:

// From https://www.dartlang.org/docs/spec/latest/dart-language-specification.html#h.huusvrzea3q

If not to the specific section, at least to the language spec.

@chalin
Copy link
Contributor

chalin commented Feb 25, 2014

IMHO, this issue is related to the following broader issue: #606, "Treat Dart maps like maps, not (JavaScript) objects with field access".

This PR (#614) takes AngularDart even further away from Dart and goes against the principle of least surprise (a principle that has been used to guide the design of Dart itself and should probably be used to guide the design of AngularDart too).

It certainly makes sense to support map key values that happen to be Dart reserved words, but, I don't think we would support fields with names that are reserved words.

Btw, is this fix (#614) in high demand? Or is it being inspired form AngularJS functionality? If the later, then we should question the wisdom of it.

chalin added a commit to chalin/angular.dart that referenced this pull request Feb 25, 2014
Reminded about this by Kasper Lund’s dart-archive#614.
@mhevery mhevery closed this in 271ecec Feb 26, 2014
@kasperl kasperl deleted the fix_reserved_words branch February 27, 2014 11:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants