Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace some props on the object returned by getMode during compile time #3772

Merged
merged 4 commits into from Jun 27, 2016

Conversation

erwinmombay
Copy link
Member

getMode().localDev == false
getMode().test == false
getMode().minified == true

@erwinmombay erwinmombay force-pushed the remove-islocaldev-closure branch 5 times, most recently from 2300d2c to 7d71ddd Compare June 27, 2016 07:21
@@ -107,8 +107,7 @@ function reportErrorToServer(message, filename, line, col, error) {
if (this && this.document) {
makeBodyVisible(this.document);
}
const mode = getMode();
Copy link
Member Author

Choose a reason for hiding this comment

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

@cramforce PTAL. works but unfortunately I don't detect re-aliasing right now, is there a way to get the type information of a return type? (I'm sure there is I just don't know how to get to it)

Copy link
Member

Choose a reason for hiding this comment

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

Lets make this illegal.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@erwinmombay erwinmombay changed the title WIP replace some props on the object returned by getMode during compile time replace some props on the object returned by getMode during compile time Jun 27, 2016
…le time

getMode().localDev == false
getMode().test == false
getMode().minified == true
* example:
* isFunctionInvokeAndPropAccess(n, "getMode", "test"); // matches `getMode().test`
*
* @param n
Copy link
Member

Choose a reason for hiding this comment

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

Remove these

@cramforce
Copy link
Member

Looks great. Lets add a presubmit check or compile error for getMode() aliasing?

@erwinmombay
Copy link
Member Author

@cramforce will do

@erwinmombay erwinmombay force-pushed the remove-islocaldev-closure branch 2 times, most recently from 478b98a to d4e8934 Compare June 27, 2016 17:33
@erwinmombay
Copy link
Member Author

@cramforce ready for review again. PTAL

@cramforce
Copy link
Member

LGTM

@erwinmombay erwinmombay merged commit 7e676ed into ampproject:master Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants