Commit 5549175
authored
Refactor has-extern? / js-tag (#246)
* fix up tests so they don't throw if no warnings
* resolve-extern, which can be used by both has-extern? and js-tag, returns both resolved prefix and var info
* remove various hacks around extern resolution (Number, Window, prototype etc.), resolve-extern handles everything
* undefined is a ref cycle, special case
* change normalize-js-tag so it marks the ctor prop
* add normalize-unresolved-prefix to fix up the cases we can't find
* add impl unit tests
* more unit test
- can finally resolve crypto.subtle, verify type inference as well
* add lift-tag-to-js helper
* in resolve-var add the ctor to the tag to track later, this also lets the extra information flow
* in analyze-dot check to see if the target is a constructor
- if it is use that as tag instead, Function is not useful
* test assertion that we can figure out the return even if a extern js ctor is bound to a local
* add compiler test case for inferring return of Number.isNaN
* add non-ctor inference for array, string, boolean and number, will be useful later
* add js/isNaN test
* add isArray extern test
* don't return raised js/Foo types for boolean, number, string
* remove ^boolean hint from array? ass test
* remove hint for make-array, add test
* remove hints for isFinite and isSafeInteger, tests
* can infer distinct?, add test
* remove various ^boolean cases no longer needed
* FIXME comments about dubious ^boolean cases
* move ^boolean hint from special-symbol? to contains? where it belongs, test case
* goog.object/containsKey type inference doesn't work for reason, leave a trail for later
* goog.string/contains does work, add test
* remove hint from NaN?
* FIXME note about re-matches, another dubious case of ^boolean hints1 parent 90a40f6 commit 5549175
File tree
8 files changed
+350
-79
lines changed- src
- main
- cljs/cljs
- clojure/cljs
- test/clojure/cljs
8 files changed
+350
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | | - | |
1059 | | - | |
| 1058 | + | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| |||
2355 | 2355 | | |
2356 | 2356 | | |
2357 | 2357 | | |
2358 | | - | |
| 2358 | + | |
2359 | 2359 | | |
2360 | 2360 | | |
2361 | 2361 | | |
| |||
2432 | 2432 | | |
2433 | 2433 | | |
2434 | 2434 | | |
2435 | | - | |
| 2435 | + | |
2436 | 2436 | | |
2437 | 2437 | | |
2438 | 2438 | | |
| |||
2462 | 2462 | | |
2463 | 2463 | | |
2464 | 2464 | | |
2465 | | - | |
| 2465 | + | |
2466 | 2466 | | |
2467 | 2467 | | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | | - | |
| 2470 | + | |
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
| |||
8351 | 8351 | | |
8352 | 8352 | | |
8353 | 8353 | | |
| 8354 | + | |
8354 | 8355 | | |
8355 | 8356 | | |
8356 | 8357 | | |
| |||
8372 | 8373 | | |
8373 | 8374 | | |
8374 | 8375 | | |
| 8376 | + | |
8375 | 8377 | | |
8376 | 8378 | | |
8377 | 8379 | | |
| |||
10562 | 10564 | | |
10563 | 10565 | | |
10564 | 10566 | | |
| 10567 | + | |
10565 | 10568 | | |
10566 | 10569 | | |
10567 | 10570 | | |
| |||
10576 | 10579 | | |
10577 | 10580 | | |
10578 | 10581 | | |
10579 | | - | |
| 10582 | + | |
10580 | 10583 | | |
10581 | 10584 | | |
10582 | 10585 | | |
| |||
11942 | 11945 | | |
11943 | 11946 | | |
11944 | 11947 | | |
11945 | | - | |
| 11948 | + | |
11946 | 11949 | | |
11947 | 11950 | | |
11948 | 11951 | | |
| |||
12175 | 12178 | | |
12176 | 12179 | | |
12177 | 12180 | | |
| 12181 | + | |
| 12182 | + | |
12178 | 12183 | | |
12179 | 12184 | | |
12180 | 12185 | | |
| |||
12268 | 12273 | | |
12269 | 12274 | | |
12270 | 12275 | | |
12271 | | - | |
| 12276 | + | |
12272 | 12277 | | |
12273 | 12278 | | |
12274 | 12279 | | |
| |||
12292 | 12297 | | |
12293 | 12298 | | |
12294 | 12299 | | |
12295 | | - | |
| 12300 | + | |
12296 | 12301 | | |
12297 | 12302 | | |
12298 | 12303 | | |
| |||
12321 | 12326 | | |
12322 | 12327 | | |
12323 | 12328 | | |
| 12329 | + | |
12324 | 12330 | | |
12325 | 12331 | | |
12326 | 12332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1034 | 1038 | | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1039 | + | |
| 1040 | + | |
1044 | 1041 | | |
1045 | | - | |
| 1042 | + | |
1046 | 1043 | | |
1047 | 1044 | | |
1048 | 1045 | | |
1049 | 1046 | | |
1050 | | - | |
| 1047 | + | |
1051 | 1048 | | |
1052 | 1049 | | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1061 | 1105 | | |
1062 | 1106 | | |
1063 | 1107 | | |
1064 | 1108 | | |
1065 | 1109 | | |
1066 | 1110 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | 1111 | | |
1072 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1073 | 1116 | | |
1074 | 1117 | | |
1075 | 1118 | | |
| |||
1078 | 1121 | | |
1079 | 1122 | | |
1080 | 1123 | | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1087 | 1131 | | |
1088 | 1132 | | |
1089 | 1133 | | |
| |||
1274 | 1318 | | |
1275 | 1319 | | |
1276 | 1320 | | |
1277 | | - | |
1278 | | - | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1279 | 1324 | | |
1280 | 1325 | | |
1281 | 1326 | | |
| |||
1284 | 1329 | | |
1285 | 1330 | | |
1286 | 1331 | | |
1287 | | - | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1288 | 1335 | | |
1289 | 1336 | | |
1290 | | - | |
| 1337 | + | |
1291 | 1338 | | |
1292 | 1339 | | |
1293 | 1340 | | |
| |||
2585 | 2632 | | |
2586 | 2633 | | |
2587 | 2634 | | |
2588 | | - | |
2589 | | - | |
2590 | | - | |
2591 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
2592 | 2639 | | |
2593 | | - | |
| 2640 | + | |
2594 | 2641 | | |
2595 | 2642 | | |
2596 | 2643 | | |
| |||
3543 | 3590 | | |
3544 | 3591 | | |
3545 | 3592 | | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
3546 | 3603 | | |
3547 | 3604 | | |
3548 | 3605 | | |
3549 | 3606 | | |
3550 | 3607 | | |
3551 | 3608 | | |
3552 | | - | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
3553 | 3612 | | |
3554 | 3613 | | |
3555 | 3614 | | |
| |||
3581 | 3640 | | |
3582 | 3641 | | |
3583 | 3642 | | |
3584 | | - | |
| 3643 | + | |
| 3644 | + | |
3585 | 3645 | | |
3586 | 3646 | | |
3587 | 3647 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | | - | |
| 644 | + | |
| 645 | + | |
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| |||
0 commit comments