Skip to content

Removing "or" assignment from exports, class and namespace declarations#512

Merged
tomblind merged 4 commits intomasterfrom
exports-cleanup
Apr 10, 2019
Merged

Removing "or" assignment from exports, class and namespace declarations#512
tomblind merged 4 commits intomasterfrom
exports-cleanup

Conversation

@tomblind
Copy link
Copy Markdown
Collaborator

@tomblind tomblind commented Apr 7, 2019

fixes #509

  • exports, class, and namespaces are now initialized as X = {} instead of X = X or {}.
  • @noClassOr has been removed as it no longer does anything
  • namespaces are only initialized if they are not being merged into a previous declaration
  • nested namespaces are now only exported if they have the export keyword
  • exported nested namespaces no longer generate a local reference in the parent if it's not needed

Copy link
Copy Markdown
Member

@Perryvw Perryvw left a comment

Choose a reason for hiding this comment

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

Looks fine to me, I do still want to test this out (tomorrow).

@tomblind
Copy link
Copy Markdown
Collaborator Author

tomblind commented Apr 8, 2019

I've added 2 things to this PR:

  • exports is now ____exports
  • exported classes are now cached in a local so they don't need to be references as ____exports.MyClass everywhere

Copy link
Copy Markdown
Member

@Perryvw Perryvw left a comment

Choose a reason for hiding this comment

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

Woops, forgot about this one. Tested it and works fine!

@tomblind tomblind merged commit 4fbf086 into master Apr 10, 2019
@tomblind tomblind deleted the exports-cleanup branch April 10, 2019 16:26
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.

How to make local exports = exports or {}; into local exports = {}; ?

2 participants