diff --git a/.babelrc b/.babelrc index e2ae8c38..91f7095f 100644 --- a/.babelrc +++ b/.babelrc @@ -6,6 +6,7 @@ "useBuiltIns": true }], "@babel/plugin-proposal-optional-catch-binding", + "@babel/plugin-proposal-optional-chaining", "@babel/plugin-external-helpers" ] } diff --git a/app/scripts/auto-type/auto-type-runner.js b/app/scripts/auto-type/auto-type-runner.js index bd99ecd8..51b2ec3b 100644 --- a/app/scripts/auto-type/auto-type-runner.js +++ b/app/scripts/auto-type/auto-type-runner.js @@ -204,7 +204,7 @@ AutoTypeRunner.prototype.resolveOp = function(op) { } return; } - if (this.context && this.context.resolved && this.context.resolved[lowerValue]) { + if (this.context?.resolved?.[lowerValue]) { op.type = 'text'; op.value = this.context.resolved[lowerValue]; return; diff --git a/package.json b/package.json index 22a0f29d..62ca11f2 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@babel/core": "^7.9.6", "@babel/plugin-external-helpers": "^7.8.3", "@babel/plugin-proposal-class-properties": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.9.0", "@babel/preset-env": "^7.9.6", "@keeweb/keeweb-native-modules": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.1.6/keeweb-native-modules.tgz", "adm-zip": "^0.4.14",