UNPKG
contracts-js
Version:
latest (0.6.3)
0.6.3
0.6.2
0.6.1
0.6.0
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.4
0.3.3
0.3.2
A contract library for JavaScript
disnetdev.com/contracts.js/
disnet/contracts.js
contracts-js
/
src
/
helper-macros.js
16 lines
(14 loc)
•
323 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let
if
= macro { rule {
$cond
:
expr
then
$then
:
expr
else
$else
:
expr
} => { (
function
() {
if
(
$cond
) {
return
$then
}
else
{
return
$else
} }.
bind
(this))() } // fall through rule {
$rest
...} => {
if
$rest
...} }
export
if
;