Skip to content

Commit

Permalink
Remove usage of constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Jan 9, 2024
1 parent edaf41e commit a7efd4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/assets/js/get-dart/download_archive.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -7623,7 +7623,7 @@ p.Jd(k)
o=p.gJS(k)
for(k=o.$ti,p=new A.a7(o,o.gB(0),k.C("a7<aL.E>")),k=k.C("aL.E");p.V();){n=p.d
if(n==null)n=k.a(n)
m=new self.HTMLOptionElement()
m=self.document.createElement("option")
n=n.f
m.text=n
m.setAttribute("value",n)
Expand Down Expand Up @@ -7694,7 +7694,7 @@ a1.setAttribute("data-os",a)
a2=a1.insertCell()
a2.textContent=o
a=self
a0=new a.HTMLSpanElement()
a0=a.document.createElement("span")
a0.textContent=" ("+A.d(A.yl(b4))+")"
a0.classList.add("muted")
a2.appendChild(a0)
Expand All @@ -7713,25 +7713,25 @@ a8=a6==="Debian package"
if(a8)if(p.iM(0,A.jm(2,0,0,null))<0)continue
else a7="dart_"+A.C5(b4)
a9=q+A.C5(b4)+"/"+A.d(B.t0.q(0,a6))+"/"+a7+A.d(B.dB.q(0,a6))
b0=new a.HTMLAnchorElement()
b0=a.document.createElement("a")
b0.text=a6
b0.setAttribute("href",a9)
a4.appendChild(b0)
b1=A.En(b4)
if(!a8)a8=b1==null||b1>38976
else a8=!1
if(a8){a4.append.apply(a4,[" "])
a8=new a.HTMLAnchorElement()
a8=a.document.createElement("a")
a8.textContent="(SHA-256)"
a8.setAttribute("href",a9+".sha256sum")
a8.classList.add("sha")
a4.appendChild(a8)}a4.appendChild(new a.HTMLBRElement())}}}}s=n.tBodies.item(0)
a4.appendChild(a8)}a4.appendChild(a.document.createElement("br"))}}}}s=n.tBodies.item(0)
if(s==null)s=i.a(s)
a1=s.insertRow()
a1.setAttribute("data-version",o)
a1.setAttribute("data-os","api")
s=self
b2=new s.HTMLSpanElement()
b2=s.document.createElement("span")
b2.textContent=" ("+A.d(A.yl(b4))+")"
b2.classList.add("muted")
r=a1.insertCell()
Expand All @@ -7743,7 +7743,7 @@ b3.SY(b4,a1)
a4=a1.insertCell()
a4.classList.add("archives")
p=p["["](0)
s=new s.HTMLAnchorElement()
s=s.document.createElement("a")
s.textContent="API docs"
s.setAttribute("href",q+p+"/api-docs/dartdocs-gen-api.zip")
a4.appendChild(s)
Expand Down
19 changes: 10 additions & 9 deletions tool/get-dart/dart_sdk_archive/lib/src/version_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class VersionSelector {
}

void addVersion(Version version) {
final option = HTMLOptionElement()
final option = (document.createElement('option') as HTMLOptionElement)
..text = version.toString()
..setAttribute('value', version.toString());
_versionSelector.appendChild(option);
Expand Down Expand Up @@ -224,9 +224,10 @@ class VersionSelector {
..setAttribute('data-os', archiveMap[name] ?? '');
final versionCell = row.insertCell()
..textContent = versionInfo.version.toString();
versionCell.appendChild(HTMLSpanElement()
..textContent = ' (${_prettyRevRef(versionInfo)})'
..classList.add('muted'));
versionCell
.appendChild((document.createElement('span') as HTMLSpanElement)
..textContent = ' (${_prettyRevRef(versionInfo)})'
..classList.add('muted'));
row.insertCell().textContent = name;
row.insertCell()
..classList.add('nowrap')
Expand Down Expand Up @@ -259,20 +260,20 @@ class VersionSelector {
'$_storageBase/channels/$channel/release/${_versionString(versionInfo)}'
'/${directoryMap[pa]}/$baseFileName${suffixMap[pa]}';

c.appendChild(HTMLAnchorElement()
c.appendChild((document.createElement('a') as HTMLAnchorElement)
..text = pa
..setAttribute('href', uri));
final svnRevisionInfo = _svnRevision(versionInfo);
if (pa != 'Dart Editor' &&
pa != 'Debian package' &&
(svnRevisionInfo == null || svnRevisionInfo > 38976)) {
c.append(' '.toJS);
c.appendChild(HTMLAnchorElement()
c.appendChild((document.createElement('a') as HTMLAnchorElement)
..textContent = '(SHA-256)'
..setAttribute('href', '$uri.sha256sum')
..classList.add('sha'));
}
c.appendChild(HTMLBRElement());
c.appendChild(document.createElement('br'));
}
}
}
Expand All @@ -282,7 +283,7 @@ class VersionSelector {
final row = (_table.tBodies.item(0) as HTMLTableSectionElement).insertRow()
..setAttribute('data-version', versionInfo.version.toString())
..setAttribute('data-os', 'api');
final rev = HTMLSpanElement()
final rev = (document.createElement('span') as HTMLSpanElement)
..textContent = ' (${_prettyRevRef(versionInfo)})'
..classList.add('muted');
row.insertCell()
Expand All @@ -296,7 +297,7 @@ class VersionSelector {
final c = row.insertCell()..classList.add('archives');
final uri = '$_storageBase/channels/$channel/release/'
'${versionInfo.version}/api-docs/dartdocs-gen-api.zip';
c.appendChild(HTMLAnchorElement()
c.appendChild((document.createElement('a') as HTMLAnchorElement)
..textContent = 'API docs'
..setAttribute('href', uri));

Expand Down

0 comments on commit a7efd4d

Please sign in to comment.