Commit 64025cb
Use the original visibility of symbols in ScopeData
Summary:
When evaluating a module, we do some funkiness with scopes during compilation. We create a scope, run enter_module, then pull that data back out with `exit_module`, and feed that to the compiler.
As part of enter_module, we copy all of that module's bindings over, but ignore their visibility, and set it to Public. When we run the compiler on that incorrect data, we spit out a module with the wrong visibilities.
Correct this so that we maintain the original visibilities (also adding a quick helper on Module. Instead of fetching the names, then grabbing the visibility for each, return the names and visibilities)
Reviewed By: ndmitchell
Differential Revision: D30916481
fbshipit-source-id: f93b1964b119db830e4c3f31465a3e8c87cc9c4c1 parent dd1e76b commit 64025cb
File tree
4 files changed
+55
-5
lines changed- starlark/src
- environment
- eval
- compiler
- tests
4 files changed
+55
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
405 | 448 | | |
406 | 449 | | |
407 | 450 | | |
| |||
0 commit comments