Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ <h2 class="no-num no-toc" id=abstract>Abstract</h2>
</p><h3 class="no-num no-toc" id=changelog>Changelog</h3>

<ul>
<li><strong>16 March 2016</strong>
<ul>
<li>Restrict Math.min + Math.max to signed.
</li></ul>
<li><strong>18 August 2014</strong>
<ul>
<li>better "putting it all together" example
Expand Down Expand Up @@ -2196,7 +2200,7 @@ <h2 id=standard-library><span class=secno>9 </span>Standard Library</h2>
<code>Math.max</code>
</td>
<td>
(<a href=#int-0><code>int</code></a>, <a href=#int-0><code>int</code></a><code>…</code>) → <a href=#signed-0><code>signed</code></a> ∧<br>
(<a href=#signed-0><code>signed</code></a>, <a href=#signed-0><code>signed</code></a><code>…</code>) → <a href=#signed-0><code>signed</code></a> ∧<br>
(<a href=#double-1><code>double</code></a>, <a href=#double-1><code>double</code></a><code>…</code>) → <a href=#double-1><code>double</code></a>
</td>
</tr>
Expand Down Expand Up @@ -2307,4 +2311,4 @@ <h2 class=no-num id=acknowledgements>Acknowledgements</h2>



</body></html>
</body></html>
26 changes: 26 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,32 @@ exports.testMaxWrongArgumentType = asmAssert(
return f;
}, { pass: false });

exports.testMinWrongArgumentType2 = asmAssert(
"unsigned is not a subtype of signed",
function m(stdlib, foreign, heap) {
"use asm";
var min = stdlib.Math.min;
function f(i0, i1) {
i0 = i0|0;
i1 = i1|0;
min(i0>>>0, i1>>>0)|0;
}
return f;
}, { pass: false });

exports.testMaxWrongArgumentType2 = asmAssert(
"unsigned is not a subtype of signed",
function m(stdlib, foreign, heap) {
"use asm";
var max = stdlib.Math.max;
function f(i0, i1) {
i0 = i0|0;
i1 = i1|0;
max(i0>>>0, i1>>>0)|0;
}
return f;
}, { pass: false });

exports.testMaxWrongReturnType = asmAssert(
"min argument types don't match",
function m(stdlib, foreign, heap) {
Expand Down