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

明日から使えない廃止された Mozilla の JavaScript / Obsolete F...

明日から使えない廃止された Mozilla の JavaScript / Obsolete Features on Mozilla JS

社内 LT で使用したスライドです

nodaguti

April 01, 2020
Tweet

More Decks by nodaguti

Other Decks in Programming

Transcript

  1. ࢲͷܦྺ • 2007: Firefox 2 ͔Β Firefox ϢʔβʔʹͳΔ • 2008:

    UserScript (Greasemonkey script) ͷ։ൃΛ࢝Ί Δ • 2009: userChrome.js script ͷ։ൃΛ࢝ΊΔ • 2010: Firefox add-on ͷ։ൃΛ࢝ΊΔ • 2015: Mozilla ͕ Chrome extension API ϕʔεͷ WebExtension ͱ͍͏࢓༷ʹҠߦΛൃදɼadd-on ։ൃ Λऴྃ͢Δ
  2. Expression Closures (ࣜΫϩʔδϟ) • Firefox 3 - Firefox 60 Ͱ࢖͑ͨ

    • Arrow function ͷઌۦ͚Έ͍ͨͳ΍ͭ • ΞυΦϯ։ൃͰ͸ׂͱॏๅͨ͠ • https://developer.mozilla.org/en-US/docs/Web/ JavaScript/Reference/Operators/Expression_Closures
  3. Array Comprehension (഑ྻ಺แ) • Firefox 30 - 58 Ͱ࢖͑ͨ •

    Mozilla ͕ ECMAScript 3.0 ࡦఆʹ޲͚ͯ Python ͬΆ͍ڍಈΛೖΕΑ͏ͱ͍ͯͨ͠ ࠒͷ΋ͷΒ͍͠ • ECMAScript 5.0 ͷޙʹվΊͯ proposal Λग़͚ͨ͠Ͳ reject ͞Εͨ • ࣮͸ for ͕ޙஔ͔Βલஔ΁ͱҰճ࢓༷͕มΘͬͨ • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/ Array_comprehensions
  4. Array Generics • Firefox 1.5 - 70 Ͱ࢖͑ͨ • ͍͍ͪͪ

    Array.prototype.slice.call() ͷΑ͏ʹॻ͔ͳͯ͘ࡁΉͷͰͱͯ΋ָͩͬ ͨ • ඪ४Խ͞Εͳ্͔ͬͨɼArray.from ΍ array spread syntax ͕ग़͖ͯͯඞཁੑ͕ ബΕͨ • https://www.fxsitecompat.dev/en-CA/docs/2019/non-standard-array-generics- have-been-deprecated/
  5. ECMAScript for XML (E4X) • Firefox 1 - Firefox 19

    Ͱ࢖͑ͨ • XML Λ native ʹѻ͑Δػೳɽཁ͸ built-in JSX Έ͍ͨͳ΋ͷɽ • ECMA-357 ͱͯ͠ඪ४Խ͞Ε͍͕ͯͨɼଞͷͲͷϒϥ΢β΋࣮૷͠ͳ͔ͬͨ • Template literals ͕ͳ͍࣌୅ʹώΞυΩϡϝϯτ༻ͱͯ͠େ׆༂ • ࢓༷͕ෳࡶͰ੬ऑੑͷԹচͱͳΓɼଞϒϥ΢βͱͷޓ׵ੑ΋֬อ͞Εͳ͔ͬ ͨͨΊ࡟আ͞Εͨ • https://developer.mozilla.org/en-US/docs/Archive/Web/E4X
  6. Object.prototype.__noSuchMethod__ • Firefox 1 - 43 Ͱ࢖͑ͨ • Ruby ͷ

    method_missing Έ͍ͨͳ΍ͭ • __de fi neGetter__, __proto__ ͷΑ͏ʹ໊લͰղܾ͢Δ͋ͨΓʹ࣌୅Λײ͡Δ • ECMAScript 6.0 Ͱ Proxy ͕ೖͬͯ͋͑ͳ͓͘໾ޚ໔ʹ • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ Object/noSuchMethod
  7. Object.prototype.watch / unwatch • Firefox 1 - 58 Ͱ࢖͑ͨ •

    Chrome ͕࣮૷͍ͯͨ͠ Object.prototype.observe Έ͍ͨͳ΍ͭ • ͲͪΒ΋ඪ४Խ͞Εͳ͍··࡟আ͞ΕΔ͜ͱʹͳͬͨ • ࣮ߦ࣌ͷ overhead ͕େׂ͖͍ʹ usecase ͕ͦΜͳʹͳ͍ͷ͕໰୊ͩͬͨΒ͍͠ • Angular 1 ܥͷ࣌୅Ͱ͸׆༂ͦ͠͏Ͱ͸͕͋ͬͨ... • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ Global_Objects/Object/watch
  8. ͓ΘΓʹ • ࣮͸·ͩ private class properties Λኲኵͱͤ͞Δ Sharp Variables ͳͲ঺հ͍ͯ͠ͳ͍΋ͷ΋͋ΔͷͰɼ

    ڵຯͷ༙͍ͨํ͸ https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/ Deprecated_and_obsolete_features ΛͲ͏ͧ • ඪ४ԽͬͯେมͰ͢Ͷ • ඪ४Խ͞Εͳ͍ͱ༰ࣻͳ͘࡟আ͞ΕΔͷͰɼBabel ͕ ͋ͬͯ΋Α͍ stage-4 ϥΠϑΛૹΓ·͠ΐ͏