Skip to content

Commit

Permalink
bump is-reference@1.2.1 + fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Jun 27, 2020
1 parent 59acd4b commit c98c5e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/compiler/compile/nodes/shared/Context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { x } from 'code-red';
import { Node, Identifier, RestElement, Property } from 'estree';
import { Node, Identifier } from 'estree';

export interface Context {
key: Identifier;
Expand Down Expand Up @@ -34,12 +34,10 @@ export function unpack_destructuring(contexts: Context[], node: Node, modifier:
const used_properties = [];

node.properties.forEach((property) => {
const props: (RestElement | Property) = (property as any);

if (props.type === 'RestElement') {
if (property.type === 'RestElement') {
unpack_destructuring(
contexts,
props.argument,
property.argument,
node => x`@object_without_properties(${modifier(node)}, [${used_properties}])` as Node
);
} else {
Expand Down

0 comments on commit c98c5e4

Please sign in to comment.