Skip to content

Instantly share code, notes, and snippets.

View bathos's full-sized avatar
⚱️
gimme elixir!

Darien Maillet Valentine bathos

⚱️
gimme elixir!
View GitHub Profile
@bathos
bathos / consequence-of-constructor-kind-derived.js
Created April 16, 2021 18:18
demonstration of the consequence of whether [[ConstructorKind]] is "base" or "derived"
// CLASS SYNTAX ////////////////////////////////////////////////////////////////
class AFoo {}
class ABar extends AFoo {}
// FUNCTION SYNTAX NEAR-EQUIV //////////////////////////////////////////////////
function BFoo() {
if (!new.target) {
throw new TypeError('Illegal constructor');
@bathos
bathos / moplogger.js
Created July 6, 2021 15:43
moplogger.js
// This is useful for a few things:
//
// 1. Checking what dictionary options are supported by some platform API.
// 2. Debugging mysterious cases where an object you pass as input to another
// API doesn’t seem to get treated the way you’re expecting.
// 3. When designing another Proxy’s handler implementation, verifying that you
// are accounting for everything correctly and that the intended abstraction
// isn’t leaking in quirky ways.
//
// ex: