Skip to content

Remove redundant checker functions and use patterns more friendly to modules #35399

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

Merged
merged 5 commits into from
Dec 2, 2019

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Nov 27, 2019

So there's a couple small things bundled in here:

  1. getObjectFlags on checker was redundant. There's a ts.getObjectFlags that it was just a copy of. So it's gone now.
  2. A shorthand reference to a namespace variable is kind of a pain to track and transform - fortunately we don't do it often, so it's easier to just change the one instance of it in our codebase (after checker.getObjectFlags is removed) to use a local variable.
  3. (Module) Namespace members are not writable, though they are mutable - this means we can't actually assign to a namespace member, but we can can assign to the variable backing that namespace member and see it update. Two instances of this were changed. The assignments were in a separate file, so we had to introduce a helper function to perform the actual set.

Do note that I'm just opening PRs to fix/work around these things as they come up while I'm working on the module transition, and I figured it's much easier to review them in little bits like this, before the big switch over, assuming the new code still works both before and after the change.

@weswigham weswigham force-pushed the compiler-changes-for-modules branch from 06c739c to 888d2f2 Compare November 28, 2019 01:54
@weswigham weswigham merged commit 7bfffa7 into microsoft:master Dec 2, 2019
@weswigham weswigham deleted the compiler-changes-for-modules branch December 2, 2019 21:44
elibarzilay added a commit to elibarzilay/TypeScript that referenced this pull request Oct 4, 2021
* shorthand -> long for `factory` since the typeformer script doesn't
  know how to handle it.

* Use setter to change `ts.sys` (similar to microsoft#35399).

* Fix `loggedIO` with empty namespaces to indicate dependency
  (similar to 50603ed).

* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
  types are there.
elibarzilay added a commit to elibarzilay/TypeScript that referenced this pull request Oct 7, 2021
* shorthand -> long for `factory` since the typeformer script doesn't
  know how to handle it.

* Use setter to change `ts.sys` (similar to microsoft#35399).

* Fix `loggedIO` with empty namespaces to indicate dependency
  (similar to 50603ed).

* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
  types are there.
elibarzilay added a commit that referenced this pull request Oct 16, 2021
* shorthand -> long for `factory` since the typeformer script doesn't
  know how to handle it.

* Use setter to change `ts.sys` (similar to #35399).

* Fix `loggedIO` with empty namespaces to indicate dependency
  (similar to 50603ed).

* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
  types are there.
mprobst pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
* shorthand -> long for `factory` since the typeformer script doesn't
  know how to handle it.

* Use setter to change `ts.sys` (similar to microsoft#35399).

* Fix `loggedIO` with empty namespaces to indicate dependency
  (similar to 50603ed).

* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
  types are there.
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.

2 participants