From e72958817d5196362daf9aa858fb7442b9f49b9b Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 30 Apr 2020 03:31:12 -0400 Subject: [PATCH] Add optional deep chain with private access This was also recently approved in TC39. I collected the results by taking the maximum of the optional chain and private instance fields results, then manually verifying the supported browsers. Only Chrome has it so far. Re: https://github.com/kangax/compat-table/pull/1612 --- data-esnext.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/data-esnext.js b/data-esnext.js index 549520e9ca..fd235d1698 100644 --- a/data-esnext.js +++ b/data-esnext.js @@ -929,6 +929,32 @@ exports.tests = [ typescript3_8corejs3: false, } }, + { + name: 'optional deep private instance class fields access', + exec: function () {/* + class C { + #x = 42; + x(o = {p: this}){ + return o?.p.#x; + } + } + return new C().x() === 42 && new C().x(null) === void 0; + */}, + res: { + ie11: false, + firefox2: false, + firefox74: firefox.privateClassFields, + chrome1: false, + chrome78: {val: 'flagged', note_id: "chrome-optional-chaining", note_html: "The feature have to be enabled via --js-flags=\"--harmony-optional-chaining\" flag"}, + chrome80: true, + safari1: false, + safari13_1: false, + opera10_50: false, + graalvm20: false, + babel7corejs3: false, + typescript3_8corejs3: false, + } + }, { name: 'computed instance class fields', exec: function () {/*