From 0f949990c33cc3c2b3dc24632f7639be166756b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 5 Nov 2019 12:28:16 -0500 Subject: [PATCH] fix: add inList setter for compatibility with babel-minify (#10656) --- packages/babel-traverse/src/path/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js index e73cbde9d1ee..79ef05092857 100644 --- a/packages/babel-traverse/src/path/index.js +++ b/packages/babel-traverse/src/path/index.js @@ -161,6 +161,13 @@ export default class NodePath { return !!this.listKey; } + set inList(inList) { + if (!inList) { + this.listKey = null; + } + // ignore inList = true as it should depend on `listKey` + } + get parentKey() { return this.listKey || this.key; }