From c98c5e400f736674ad675fcab7477c07bffadd5f Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Sat, 27 Jun 2020 11:07:04 +0800 Subject: [PATCH] bump is-reference@1.2.1 + fix types --- package-lock.json | 14 +++++++------- src/compiler/compile/nodes/shared/Context.ts | 8 +++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1bb4bbfffd..25b0b67035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -167,9 +167,9 @@ "dev": true }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", "dev": true }, "@types/is-windows": { @@ -2250,12 +2250,12 @@ "dev": true }, "is-reference": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", - "integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", "dev": true, "requires": { - "@types/estree": "0.0.39" + "@types/estree": "*" } }, "is-regex": { diff --git a/src/compiler/compile/nodes/shared/Context.ts b/src/compiler/compile/nodes/shared/Context.ts index 797405b0fe..bcc0521ffa 100644 --- a/src/compiler/compile/nodes/shared/Context.ts +++ b/src/compiler/compile/nodes/shared/Context.ts @@ -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; @@ -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 {