tc39 proposals

tc39 proposals

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

Transcript

  1. 6.

    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. 11.

    function save(filename = do { throw new TypeError("Argument required”) })

    { } // σϑΥϧτύϥϝʔλͰͷdoࣜ͸·ͩະఆ
  3. 12.

    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. 16.

    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. 19.

    const myValues = new Map(); const components = [a, b];

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