From 6b75820802e422c96184a6bd6fe287dfc1ed8aaa Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 7 Sep 2019 23:03:13 -0400 Subject: [PATCH] simplify --- src/compiler/compile/nodes/shared/Expression.ts | 6 +----- src/compiler/compile/render_dom/index.ts | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/compiler/compile/nodes/shared/Expression.ts b/src/compiler/compile/nodes/shared/Expression.ts index bb51c3b14b..542e9d1702 100644 --- a/src/compiler/compile/nodes/shared/Expression.ts +++ b/src/compiler/compile/nodes/shared/Expression.ts @@ -7,10 +7,8 @@ import { Node } from '../../../interfaces'; import { globals , sanitize } from '../../../utils/names'; import deindent from '../../utils/deindent'; import Wrapper from '../../render_dom/wrappers/shared/Wrapper'; - import TemplateScope from './TemplateScope'; import get_object from '../../utils/get_object'; -// import { nodes_match } from '../../../utils/nodes_match'; import Block from '../../render_dom/Block'; import { INode } from '../interfaces'; import is_dynamic from '../../render_dom/wrappers/shared/is_dynamic'; @@ -394,9 +392,7 @@ export default class Expression { // (a or b). In destructuring cases (`[d, e] = [e, d]`) there // may be more, in which case we need to tack the extra ones // onto the initial function call - const names = new Set(assignee.type === 'MemberExpression' - ? [get_object(assignee).name] - : extract_names(assignee)); + const names = new Set(extract_names(assignee)); const traced: Set = new Set(); names.forEach(name => { diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index 26e5d04311..73655ce6ed 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -7,8 +7,6 @@ import { CompileOptions } from '../../interfaces'; import { walk } from 'estree-walker'; import { stringify_props } from '../utils/stringify_props'; import add_to_set from '../utils/add_to_set'; -import get_object from '../utils/get_object'; -// import { extract_names } from '../utils/scope'; import { nodes_match } from '../../utils/nodes_match'; import { extract_names } from '../utils/scope'; @@ -179,9 +177,7 @@ export default function dom( // (a or b). In destructuring cases (`[d, e] = [e, d]`) there // may be more, in which case we need to tack the extra ones // onto the initial function call - const names = new Set(assignee.type === 'MemberExpression' - ? [get_object(assignee).name] - : extract_names(assignee)); + const names = new Set(extract_names(assignee)); const [head, ...tail] = Array.from(names).filter(name => { const owner = scope.find_owner(name);