Commit 8d9fa68
committed
Avoid global mutations
This removes a few places where global compiler bindings are mutated:
1. Make `sysLog` call an internal binding which is changed via
`setSysLog`.
2. Use `Object.assign` to change values *in* `objectAllocator` instead
of mutating the binding itself. (The type should verify that any
future uses of this will properly override all bindings.)
3. `localizedDiagnosticMessages` is not really needed as an exported
value, there's only one place that uses it to test whether it is set
or not. So drop the export and replace it with a new
`maybeSetLocalizedDiagnosticMessages` (internal) function.1 parent 9e2b7ad commit 8d9fa68
3 files changed
+19
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| 502 | + | |
| 503 | + | |
502 | 504 | | |
503 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
504 | 508 | | |
505 | 509 | | |
506 | 510 | | |
507 | | - | |
| 511 | + | |
508 | 512 | | |
509 | 513 | | |
510 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5899 | 5899 | | |
5900 | 5900 | | |
5901 | 5901 | | |
5902 | | - | |
| 5902 | + | |
5903 | 5903 | | |
5904 | 5904 | | |
5905 | 5905 | | |
| |||
5912 | 5912 | | |
5913 | 5913 | | |
5914 | 5914 | | |
5915 | | - | |
| 5915 | + | |
5916 | 5916 | | |
5917 | 5917 | | |
5918 | 5918 | | |
5919 | 5919 | | |
5920 | 5920 | | |
5921 | 5921 | | |
5922 | | - | |
| 5922 | + | |
5923 | 5923 | | |
5924 | 5924 | | |
5925 | 5925 | | |
5926 | 5926 | | |
5927 | 5927 | | |
5928 | 5928 | | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
| 5932 | + | |
| 5933 | + | |
| 5934 | + | |
| 5935 | + | |
5929 | 5936 | | |
5930 | 5937 | | |
5931 | 5938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1266 | 1265 | | |
1267 | 1266 | | |
1268 | 1267 | | |
| |||
0 commit comments