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
foo | bar | 123 |
---|
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 A { } | |
class B extends A { | |
method() { super.x = 1; return super.x; } | |
} | |
var b = new B(); | |
b.method(); // undefined (no property x on A.prototype or above) | |
b.hasOwnProperty('x'); // true (own property created on receiver by [[set]]) | |
class C extends B { | |
get x() { return "gotten" } |
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
async function Person() { | |
this.name = await getName(); | |
} | |
// seems weird-ish. | |
var p = new Person(); | |
p.then(person => console.log(person.name)); | |
// but seems better in another async function | |
async function CreatePerson() { |
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
function concat(head, template) { | |
"use strict"; | |
var head; | |
if(!template) { | |
template = head; | |
head = ''; | |
} | |
var fn = concat.bind(null, head + template[0]); |
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
1. L0 | |
1. L1 | |
1. L2 | |
1. L2 | |
1. L3 | |
1. here | |
2. here | |
3. here |
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 _ = require('highland'); | |
var Readable = require('stream').Readable; | |
var Writable = require('stream').Writable; | |
var util = require('util'); | |
util.inherits(Tributary, Writable); | |
function Tributary() { | |
Writable.call(this, { objectMode: true }); | |
this.forks = []; |
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 A { | |
if (defineBar) { | |
bar => { | |
} | |
} | |
while(needsMoreMethods) { | |
// add more methods | |
} |
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 Cancellation extends Error { }; | |
class CancellablePromise extends Promise { | |
constructor(resolver, onCancelled) { | |
this._onCancelled = onCancelled; | |
this._isResolved = false; | |
super((resolve, reject) => { | |
this._reject = reject; | |
const wrappedResolve = value => { resolve(value); this._isResolved = true; }; | |
const wrappedReject = reason => { reject(reason); this._isResolved = true; }; |
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
<es-intro> | |
<p>Introductory matter. Could probably be an intro attribute on clauses</p> | |
</es-intro> | |
<es-clause title="Greetings" anchor="sec-greetings"> | |
<!-- anchor is optional, is calculated for you if you don't specify --> | |
<p>Clauses are normative and contain text...</p> | |
<es-clause title="sub-clause"> | |
<p>When evaluating <es-nt>BindingElement</es-nt>, you better do it right!</p> |
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
1. Let O be the result of calling ToObject passing the this value as the argument. | |
2. ReturnIfAbrupt(O). | |
3. Let lenVal be the result of Get(O, "length") | |
4. Let len be ToLength(lenVal). | |
5. ReturnIfAbrupt(len). | |
6. Let argCount be the number of actual arguments. | |
7. If argCount > 0 then | |
a. Let k be len. | |
b. Repeat, while k > 0, | |
i. Let from be ToString(k–1). |