From 628006abc2c1dfb8eb9c42751a8500dc89d2fb6c Mon Sep 17 00:00:00 2001 From: cilame Date: Sat, 20 Nov 2021 21:53:52 +0800 Subject: [PATCH] add --- tools/babel_asttool.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/babel_asttool.js b/tools/babel_asttool.js index 9e154b7..be6649d 100644 --- a/tools/babel_asttool.js +++ b/tools/babel_asttool.js @@ -32489,11 +32489,13 @@ function MergeObj(path) { } }) paths.map(function(refer_path) { - let bindpath = refer_path.parentPath; - if (!t.isVariableDeclarator(bindpath.node)) return; - let bindname = bindpath.node.id.name; - bindpath.scope.rename(bindname, name, bindpath.scope.block); - bindpath.remove(); + try{ + let bindpath = refer_path.parentPath; + if (!t.isVariableDeclarator(bindpath.node)) return; + let bindname = bindpath.node.id.name; + bindpath.scope.rename(bindname, name, bindpath.scope.block); + bindpath.remove(); + }catch(e){} }); }