From e4cb01498df6096b66edb0c78965ee6f47d3ac77 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 20 Aug 2019 19:28:52 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20add=20null=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/get-string-if-constant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get-string-if-constant.js b/src/get-string-if-constant.js index 8deeaf6..751018a 100644 --- a/src/get-string-if-constant.js +++ b/src/get-string-if-constant.js @@ -8,7 +8,7 @@ import { getStaticValue } from "./get-static-value" */ export function getStringIfConstant(node, initialScope = null) { // Handle the literals that the platform doesn't support natively. - if (node.type === "Literal" && node.value === null) { + if (node && node.type === "Literal" && node.value === null) { if (node.regex) { return `/${node.regex.pattern}/${node.regex.flags}` }