Skip to content

Instantly share code, notes, and snippets.

View jorendorff's full-sized avatar

Jason Orendorff jorendorff

View GitHub Profile
/*
* Sketch of the API surface we would need to expose
* in order to shift the Promise implementation from dom to js/src.
*/
namespace JS {
/*
* Microtask API.
*
var i = 0;
function f() {
i++;
return f() + 1;
}
try {
f();
} catch (exc) {
}

Summary of high-level feature work for ES6

symbols

  • new value tag
  • sling throug hthe property sites
  • audit tag examiners
  • teach the jits
  • ensure TI sanity with new jsids

tail calls

for line in (line for line in (line.strip() for line in res.out.split('\n')) if line):
...
for line in filter(bool, (line.strip() for line in res.out.split('\n'))):
...
for line in filter(bool, map(lambda ln: ln.strip(), res.out.split('\n'))):
...
@jorendorff
jorendorff / gist:9192015
Last active August 29, 2015 13:56 — forked from getify/gist:9105362
function* range(start, stop, step=1) {
for (var i = start; i < stop; i += step)
yield i;
}
for (var n of range(0, 100, 3))
console.log(n);

λ-calculus Bonus Material!

Credit where it’s due

The author of the talk I gave yesterday at PyTennessee is Jim Blandy. Jim is a Mozilla engineer, a go player, a drinker of tea, and one of the most generous people I’ve ever met.

Bits and pieces

  • Are the Church numerals 32-bit integers? Or 64-bit integers? Or do they go on forever?

8:00 - Preparation

  • Jason will bring nametags, pens, water bottles, some Cokes, ice, a cooler
  • get coffee from Bongo Java (and bagels?)
  • open doors, tape up a sign or two ("this way to Click")
  • make sure wifi is working

9:00 - Attendees start to appear

  • greet and mix
unfortunately I don't have the full log, joined the channel too late.
... humph asks how to make it so sites like Netflix can't break the developer tools by futzing with window.console ...
<@khuey> r-
<ehsan> humph: but we can't take that patch!
<humph> for sure
<humph> but that doesn't mean it can't be written!
<ehsan> true!
<humph> the world needs more protest patching :)

How it's written:

2. If O supports named properties, O does not implement an interface with the [Global] or [PrimaryGlobal] extended attribute and P is not an unforgeable property name of O, then:

    1. Let creating be true if P is not a supported property name, and false otherwise.
    2. If O implements an interface with the [OverrideBuiltins] extended attribute or O does not have an own property named P, then:
        1. If creating is false and O does not implement an interface with a named property setter, then Reject.
        2. If creating is false or O implements an interface with a named property creator, then:
            1. If the result of calling IsDataDescriptor(Desc) is false, then Reject.
  1. Let operation be the operation used to declare the named property creator if creating is true, or the named property setter if creating is false.
if returnType is None or returnType.isVoid():
# Nothing to declare
return None, False, None, None
if returnType.isPrimitive() and returnType.tag() in builtinNames:
result = CGGeneric(builtinNames[returnType.tag()])
if returnType.nullable():
result = CGTemplatedType("Nullable", result)
return result, False, None, None
if returnType.isDOMString():
if isMember: