Skip to content

Instantly share code, notes, and snippets.

View codehag's full-sized avatar
🍁
unresponsive until Nov. 2023

yulia codehag

🍁
unresponsive until Nov. 2023
View GitHub Profile
@codehag
codehag / research.md
Last active February 25, 2021 15:52
How we research

How we research

You have an idea for a new JavaScript proposal, but don't know exactly what shape it should take? This document is for you!

Getting started

If you are new to research, it might be overwhelming at first. For this, there is a great intro video series to help get your feet on the ground.

Techniques:

@codehag
codehag / gist:677fab08889190124851b9b93490915b
Last active September 30, 2023 03:34
Data Structures for TC39

Data Structures

This file is for bike shedding data structures for TC39

Proposals repo data structure

Current data structure

[
@codehag
codehag / twitchmonkey.js
Last active July 3, 2020 12:14
A teaching aid for the spidermonkey engine
function lex(string) {
return string
.match(/a|b|c|d/g)
.map(token => token.toUpperCase());
}
// This language has no structure, so we are jumping straight to bytecode rather than first building
// an AST
function parse(tokens) {
const bytecode = [];
@codehag
codehag / option_1.js
Last active September 30, 2023 03:35 — forked from jorendorff/option_1.js
"use strict";
Iterator.prototype = {
*map(mapper) {
for (let value of this) {
yield mapper(value);
}
},
};

Core Proposal real-world examples

Living Document. J. S. Choi, 2018-12.

WHATWG Fetch Standard

The [WHATWG Fetch Standard][] contains several examples of using the DOM fetch function, resolving its promises into values, then processing the values in various ways. These examples may become more easily readable with smart pipelines.

@codehag
codehag / stg2.md
Last active January 31, 2020 13:35
Stage 2

Stage 2

Needs pre-review? Proposal Author Champion Last Presented
no [function.sent metaproperty][function-sent] Allen Wirfs-Brock 贺师俊 (HE Shi-Jun) [July 2019][function-sent-notes]
yes [Decorators][decorators]
@codehag
codehag / new.js
Last active January 30, 2020 09:40
changes in js 2020
var regex = /t(e)(st(\d?))/g;
var string = 'test1test2';
string.match(regex); // gives ['test1', 'test2'] - how do i get the capturing groups?
var matches = [];
var lastIndexes = {};
var match;
lastIndexes[regex.lastIndex] = true;
while (match = regex.exec(string)) {
@codehag
codehag / tc39-10-2019.md
Last active September 30, 2023 03:37
TC39 meeting, October 1-2 2019

TC39 meeting, October 1-3rd 2019

Summary

Not much significant change that we need to be worried about but lot of new proposals moved to stage 1. We have some reviewing work to do, as there is so much new stuff.

Need Review:

// TabDescriptorActor
const TabDescriptorActor = ActorClassWithSpec(descriptorSpec, {
initialize(connection, options = {}) {
Actor.prototype.initialize.call(this, connection);
this.tabList = options.tabList;
this.destroy = this.destroy.bind(this);
},
async getTarget() {
const tabList = this.tabList;