-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite specification. Also remove implementation and change some meta things (per other proposals).
- Loading branch information
1 parent
fbf4b5a
commit 513523e
Showing
14 changed files
with
129 additions
and
169 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,4 +1,46 @@ | ||
output/ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
package-lock.json | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Only apps should have lockfiles | ||
yarn.lock | ||
package-lock.json | ||
npm-shrinkwrap.json | ||
pnpm-lock.yaml | ||
|
||
# Build directory | ||
build |
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,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Richie Bendall <[email protected]> | ||
Copyright (c) 2024 ECMA TC39 and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
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,39 +1,23 @@ | ||
{ | ||
"name": "proposal-math-clamp", | ||
"version": "0.1.0", | ||
"description": "ECMAScript reference implementation for `Math.clamp`.", | ||
"repository": "Richienb/proposal-math-clamp", | ||
"author": { | ||
"name": "Richie Bendall", | ||
"email": "[email protected]" | ||
}, | ||
"license": "MIT", | ||
"type": "module", | ||
"exports": { | ||
".": "./implementation.js", | ||
"./polyfill": "./polyfill.js" | ||
}, | ||
"files": [ | ||
"implementation.js", | ||
"implementation.d.ts", | ||
"polyfill.js" | ||
], | ||
"engines": { | ||
"node": ">=12.20" | ||
}, | ||
"scripts": { | ||
"docs": "ecmarkup spec.html output/index.html --lint-spec", | ||
"test": "xo && node ./test-implementation.js" | ||
}, | ||
"keywords": [ | ||
"math", | ||
"clamp" | ||
], | ||
"dependencies": { | ||
"es-abstract": "^1.20.1" | ||
}, | ||
"devDependencies": { | ||
"ecmarkup": "^9.4.1", | ||
"xo": "^0.45.0" | ||
} | ||
"private": true, | ||
"name": "template-for-proposals", | ||
"description": "A repository template for ECMAScript proposals.", | ||
"scripts": { | ||
"start": "npm run build-loose -- --watch", | ||
"build": "npm run build-loose -- --strict", | ||
"build-loose": "node -e 'fs.mkdirSync(\"build\", { recursive: true })' && ecmarkup --load-biblio @tc39/ecma262-biblio --verbose spec.emu build/index.html --lint-spec" | ||
}, | ||
"homepage": "https://github.com/tc39/template-for-proposals#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tc39/template-for-proposals.git" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@tc39/ecma262-biblio": "2.1.2778", | ||
"ecmarkup": "^20.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 12" | ||
} | ||
} |
This file was deleted.
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,36 @@ | ||
<!doctype html> | ||
<meta charset="utf8"> | ||
<link rel="stylesheet" href="./spec.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css"> | ||
<script src="./spec.js"></script> | ||
<pre class="metadata"> | ||
title: Math.clamp | ||
stage: 0 | ||
contributors: Oliver Medhurst, Richie Bendall | ||
</pre> | ||
|
||
<emu-intro id="intro"> | ||
<h1>Introduction</h1> | ||
<p><a href="https://github.com/CanadaHonk/proposal-math-clamp">`Math.clamp()` constrains a value between an upper and lower bound.</a></p> | ||
</emu-intro> | ||
|
||
<emu-clause id="sec-math.clamp"> | ||
<h1>Math.clamp ( _value_, _min_, _max_ )</h1> | ||
<p>This function returns the Number value that is the result of constraining _number_ between the bounds defined by _min_ and _max_.</p> | ||
<emu-alg> | ||
1. If _value_ is not a Number, throw a *TypeError* exception. | ||
1. If _min_ is not a Number, throw a *TypeError* exception. | ||
1. If _min_ is *NaN*, throw a *RangeError* exception. | ||
1. If _max_ is not a Number, throw a *TypeError* exception. | ||
1. If _max_ is *NaN*, throw a *RangeError* exception. | ||
1. If _min_ ≥ _max_, throw a *RangeError* exception. | ||
1. If _value_ is *NaN*, return *NaN*. | ||
1. If _value_ is *-0*<sub>𝔽</sub> and _min_ is *+0*<sub>𝔽</sub>, return _min_. | ||
1. If _value_ is *+0*<sub>𝔽</sub> and _min_ is *-0*<sub>𝔽</sub>, return _min_. | ||
1. If _value_ < _min_, return _min_. | ||
1. If _value_ is *-0*<sub>𝔽</sub> and _max_ is *+0*<sub>𝔽</sub>, return _max_. | ||
1. If _value_ is *+0*<sub>𝔽</sub> and _max_ is *-0*<sub>𝔽</sub>, return _max_. | ||
1. If _value_ > _max_, return _max_. | ||
1. Return _value_. | ||
</emu-alg> | ||
</emu-clause> |
This file was deleted.
Oops, something went wrong.