This file contains hidden or 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
class Class { | |
@Bound | |
method() {} | |
@Lazy | |
get data() {} | |
} | |
function Bound(prototype, name, descriptor) { | |
const { value, writable, enumerable, configurable } = descriptor; |
This file contains hidden or 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
/* | |
ES7 | |
``` | |
async function f() { | |
await ... | |
} | |
``` |
This file contains hidden or 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
var VDOMWorkerRenderer = require('./vdom-worker-renderer'); | |
var renderer = new VDOMWorkerRenderer(function (h) { | |
return function ui(state) { | |
return counter(state.counter) | |
}; | |
function counter(value) { | |
return h('div', { className: 'counter' }, [String(value)]); | |
} |
This file contains hidden or 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
var foldr = Function.prototype.call.bind(Array.prototype.reduceRight); | |
var source = [9, 8, 7]; | |
var pipeline = compose(filter(odd), map(add(1))); | |
var pusher = { | |
step: function (arr, value) { arr.push(value); return arr; }, | |
result: identity | |
}; |
This file contains hidden or 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
context.f(...args) | |
f.call(context, ...args) | |
Function.prototype.call.bind(f)(context, ...args) | |
Function.prototype.bind.bind(Function.prototype.call)(f)(context, ...args) |
This file contains hidden or 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
macro π { | |
rule {} => { Math.PI } | |
} | |
export π; |
This file contains hidden or 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
macro inline_findIndex { | |
rule { ($list:expr, function ($value:ident, $index:ident, $ref:ident) { | |
$return:expr | |
}, $context:expr) } => { | |
(function ($ref) { | |
var length = $ref.length; | |
for (var $index = 0; $index < length; $index += 1) { | |
var $value = $ref[$index]; | |
This file contains hidden or 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
macro inline_find { | |
rule { ($list:expr, function ($value:ident, $index:ident, $ref:ident) { | |
$return:expression | |
}, $context:expr) } => { | |
(function ($ref) { | |
var length = $ref.length; | |
for (var $index = 0; $index < length; $index += 1) { | |
var $value = $ref[$index]; | |
This file contains hidden or 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
macro inline_from { | |
rule { ($constructor:expr, $list:expr, function ($value:ident, $index:ident, $ref:ident) { | |
$return:expr | |
}, $context:expr) } => { | |
(function (constructor, ref) { | |
var length = ref.length, res = new constructor(length); | |
for (var $index = 0; $index < length; $index += 1) { | |
var $value = ref[$index]; | |