-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from tc39/new-spec
- Loading branch information
Showing
18 changed files
with
9,558 additions
and
5,212 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const state = { | ||
__folded: true, | ||
get folded() { | ||
try { | ||
const v = localStorage.getItem("folded"); | ||
return v === "true" || v === null; | ||
} catch { | ||
return this.__folded; | ||
} | ||
}, | ||
set folded(val) { | ||
this.__folded = val; | ||
try { | ||
localStorage.setItem("folded", val); | ||
} catch {} | ||
document.body.classList.toggle("folded", val); | ||
}, | ||
}; | ||
state.folded = state.folded; | ||
|
||
const button = document.querySelector("#expand"); | ||
button.addEventListener("click", () => { | ||
state.folded = !state.folded; | ||
if (state.folded) { | ||
const old = scrollY; | ||
location.hash = ""; | ||
scrollTo(0, old); | ||
} | ||
}); | ||
|
||
function onHashChange(event) { | ||
const target = document.getElementById(location.hash.slice(1)); | ||
if (!target) return; | ||
if (!state.folded) return; | ||
for (const el of document.querySelectorAll(".fold")) { | ||
if (el.contains(target)) { | ||
state.folded = false; | ||
target.scrollIntoView(true); | ||
setExpand(false); | ||
} | ||
} | ||
} | ||
window.addEventListener("hashchange", onHashChange); | ||
window.addEventListener("DOMContentLoaded", onHashChange); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"private": true, | ||
"name": "proposal-pattern-matching", | ||
"description": "A repository for ECMAScript pattern matching proposals.", | ||
"scripts": { | ||
"start": "npm run build -- --watch", | ||
"build": "SOURCE_DATE_EPOCH=$(git log -1 --pretty=\"format:%ct\" spec.emu) ecmarkup spec.emu index.html --load-biblio @tc39/ecma262-biblio --lint-spec" | ||
}, | ||
"homepage": "https://github.com/tc39/proposal-pattern-matching#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tc39/proposal-pattern-matching.git" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@tc39/ecma262-biblio": "^2.1.2631", | ||
"ecmarkup": "^17.1.1" | ||
} | ||
"private": true, | ||
"name": "proposal-pattern-matching", | ||
"description": "A repository for ECMAScript pattern matching proposals.", | ||
"scripts": { | ||
"start": "npm run build -- --watch", | ||
"build": "SOURCE_DATE_EPOCH=$(git log -1 --pretty=\"format:%ct\" spec.emu) ecmarkup spec.emu index.html --load-biblio @tc39/ecma262-biblio --lint-spec --assets-dir assets --mark-effects" | ||
}, | ||
"homepage": "https://github.com/tc39/proposal-pattern-matching#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tc39/proposal-pattern-matching.git" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@tc39/ecma262-biblio": "^2.1.2653", | ||
"ecmarkup": "^18.0.0" | ||
} | ||
} |
Oops, something went wrong.