Upgrade to Pro — share decks privately, control downloads, hide ads and more …

tc39 proposals

tc39 proposals

tc39のproposals
throw expression
richer-keys
class-access-expression

More Decks by Taketoshi Aono(青野健利 a.k.a brn)

Other Decks in Programming

Transcript

  1. function getEncoder(encoding) { const encoder = encoding === "utf8" ?

    new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(f alse) : encoding === "utf16be" ? new UTF16Encoder(t rue) : throw new Error("Unsupported encoding"); }
  2. function save(filename = do { throw new TypeError("Argument required”) })

    { } // σϑΥϧτύϥϝʔλͰͷdoࣜ͸·ͩະఆ
  3. function getEncoder(encoding) { const encoder = encoding === "utf8" ?

    new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(f alse) : encoding === "utf16be" ? new UTF16Encoder(t rue) : do { throw new Error("Unsupported encoding”); } }
  4. new Map([], { toKey(key) {return normalizedKey;}, toValue(value) {return normalizedValue;}, });

    new WeakMap([], { toKey(key) {return normalizedKey;}, toValue(value) {return normalizedValue;}, }); new Set([], { toValue(value) {return normalizedValue;}, }); new WeakSet([], { toValue(value) {return normalizedValue;}, });
  5. const myValues = new Map(); const components = [a, b];

    const myKey = compositeKey(...components); myValues.set(myKey, components); // ... let [a, b] = myValues.get(myKey);