Remove unused owner field in unpack_destructuring

pull/8386/head
Nguyen Tran 4 years ago
parent 4fc2e3960e
commit 4ce018b0b5

@ -35,12 +35,12 @@ export default class AwaitBlock extends Node {
if (this.then_node) { if (this.then_node) {
this.then_contexts = []; this.then_contexts = [];
unpack_destructuring({ contexts: this.then_contexts, node: info.value, scope, component, context_rest_properties: this.context_rest_properties, owner: this }); unpack_destructuring({ contexts: this.then_contexts, node: info.value, scope, component, context_rest_properties: this.context_rest_properties });
} }
if (this.catch_node) { if (this.catch_node) {
this.catch_contexts = []; this.catch_contexts = [];
unpack_destructuring({ contexts: this.catch_contexts, node: info.error, scope, component, context_rest_properties: this.context_rest_properties, owner: this }); unpack_destructuring({ contexts: this.catch_contexts, node: info.error, scope, component, context_rest_properties: this.context_rest_properties });
} }
this.pending = new PendingBlock(component, this, scope, info.pending); this.pending = new PendingBlock(component, this, scope, info.pending);

@ -61,8 +61,7 @@ export default class ConstTag extends Node {
node: this.node.expression.left, node: this.node.expression.left,
scope: this.scope, scope: this.scope,
component: this.component, component: this.component,
context_rest_properties: this.context_rest_properties, context_rest_properties: this.context_rest_properties
owner: this
}); });
this.expression = new Expression(this.component, this, this.scope, this.node.expression.right); this.expression = new Expression(this.component, this, this.scope, this.node.expression.right);
this.contexts.forEach(context => { this.contexts.forEach(context => {

@ -42,7 +42,7 @@ export default class EachBlock extends AbstractBlock {
this.scope = scope.child(); this.scope = scope.child();
this.context_rest_properties = new Map(); this.context_rest_properties = new Map();
this.contexts = []; this.contexts = [];
unpack_destructuring({ contexts: this.contexts, node: info.context, scope, component, owner: this, context_rest_properties: this.context_rest_properties }); unpack_destructuring({ contexts: this.contexts, node: info.context, scope, component, context_rest_properties: this.context_rest_properties });
this.contexts.forEach(context => { this.contexts.forEach(context => {
if (context.type !== 'DestructuredVariable') return; if (context.type !== 'DestructuredVariable') return;

@ -5,7 +5,6 @@ import is_reference, { NodeWithPropertyDefinition } from 'is-reference';
import { clone } from '../../../utils/clone'; import { clone } from '../../../utils/clone';
import Component from '../../Component'; import Component from '../../Component';
import flatten_reference from '../../utils/flatten_reference'; import flatten_reference from '../../utils/flatten_reference';
import { INode } from '../interfaces';
import TemplateScope from './TemplateScope'; import TemplateScope from './TemplateScope';
export type Context = DestructuredVariable | ComputedProperty; export type Context = DestructuredVariable | ComputedProperty;
@ -32,7 +31,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props = 0 number_of_computed_props = 0
}: { }: {
contexts: Context[]; contexts: Context[];
@ -42,7 +40,6 @@ export function unpack_destructuring({
scope: TemplateScope; scope: TemplateScope;
component: Component; component: Component;
context_rest_properties: Map<string, Node>; context_rest_properties: Map<string, Node>;
owner: INode;
number_of_computed_props?: number; number_of_computed_props?: number;
}) { }) {
if (!node) return; if (!node) return;
@ -73,7 +70,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
context_rest_properties.set((element.argument as Identifier).name, element); context_rest_properties.set((element.argument as Identifier).name, element);
@ -95,7 +91,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
} else { } else {
@ -107,7 +102,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
} }
@ -128,7 +122,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
context_rest_properties.set((property.argument as Identifier).name, property); context_rest_properties.set((property.argument as Identifier).name, property);
@ -183,7 +176,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
} else { } else {
@ -196,7 +188,6 @@ export function unpack_destructuring({
scope, scope,
component, component,
context_rest_properties, context_rest_properties,
owner,
number_of_computed_props number_of_computed_props
}); });
} }

Loading…
Cancel
Save