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

feat(const): Translate CONST_EXPR to const expressions. #151

Merged
merged 2 commits into from
May 8, 2015
Merged

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented May 8, 2015

This allows to construct compile time literal (const) expressions in Dart, e.g.

const bools = CONST_EXPR([true, false, FileNotFound]);

This allows to construct compile time literal (const) expressions in Dart, e.g.

    const bools = CONST_EXPR([true, false, FileNotFound]);
@mprobst
Copy link
Contributor Author

mprobst commented May 8, 2015

Allows progress on angular/angular#1524.

@tbosch @pkozlowski-opensource FYI.

@pkozlowski-opensource
Copy link

@mprobst awesome. Shell we have the CONST_EXPR defined on the JS/TS side somewhere as well to have one code working correctly for both JS and Dart?

@mprobst
Copy link
Contributor Author

mprobst commented May 8, 2015

@pkozlowski-opensource yes, the idea is that the TS code would have a global function in lang.ts.

Actually let me make sure we'll filter a CONST_EXPR import from the Dart output to make this a bit nicer.

Remove both the annotations and the corresponding imports.
@mprobst
Copy link
Contributor Author

mprobst commented May 8, 2015

This also fixes #13 now.

@tbosch
Copy link

tbosch commented May 8, 2015

+1!

@mprobst
Copy link
Contributor Author

mprobst commented May 8, 2015

@alexeagle I'm off for the day, please merge & release if you think this is fine, or take over the change if you think it isn't.

@alexeagle
Copy link
Contributor

Looks great, merging now.

alexeagle added a commit that referenced this pull request May 8, 2015
feat(const): Translate CONST_EXPR to const expressions.
@alexeagle alexeagle merged commit 318bcc5 into master May 8, 2015
@alexeagle alexeagle deleted the const-fn branch May 8, 2015 18:19
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Development

Successfully merging this pull request may close these issues.

5 participants