@@ -11,6 +11,7 @@ import {
11
11
VersionedStats ,
12
12
VersionItem ,
13
13
} from "@site/src/components/conformance/types" ;
14
+ import { url } from "node:inspector" ;
14
15
15
16
// Take a search param and create a state object
16
17
export function createUrlState ( search : string ) : UrlState {
@@ -31,18 +32,21 @@ export function updateInitialConformanceState(
31
32
! conformanceState &&
32
33
( urlState . versionTag || urlState . testPath || urlState . selectedTest )
33
34
) {
35
+ const selectedTest = urlState . testPath ? urlState . selectedTest : undefined ;
36
+ const tagName = ( ! urlState . versionTag ) && urlState . testPath ? "main" : urlState . versionTag ;
34
37
const fetchUrl =
35
- urlState . versionTag === "main"
38
+ tagName === "main"
36
39
? `https://raw.githubusercontent.com/boa-dev/data/main/test262/refs/heads/main/latest.json`
37
- : `https://raw.githubusercontent.com/boa-dev/data/main/test262/refs/tags/${ urlState . versionTag } /latest.json` ;
40
+ : `https://raw.githubusercontent.com/boa-dev/data/main/test262/refs/tags/${ tagName } /latest.json` ;
38
41
39
42
const testPath = urlState . testPath || [ ] ;
43
+ if ( ! tagName && testPath . length == 0 && ! selectedTest ) return conformanceState ;
40
44
return {
41
- version : { tagName : urlState . versionTag , fetchUrl } ,
42
- testPath : [ urlState . versionTag , ...testPath ] ,
45
+ version : { tagName, fetchUrl } ,
46
+ testPath : [ tagName , ...testPath ] ,
43
47
ecmaScriptVersion : undefined ,
44
48
sortOption : availableSortingOptions [ 0 ] . id ,
45
- selectedTest : urlState . selectedTest ,
49
+ selectedTest : selectedTest ,
46
50
} ;
47
51
}
48
52
return conformanceState ;
0 commit comments