Skip to content

Commit e4cb014

Browse files
committedAug 20, 2019
šŸ› add null test
1 parent 230a4e2 commit e4cb014

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

ā€Žsrc/get-string-if-constant.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getStaticValue } from "./get-static-value"
88
*/
99
export function getStringIfConstant(node, initialScope = null) {
1010
// Handle the literals that the platform doesn't support natively.
11-
if (node.type === "Literal" && node.value === null) {
11+
if (node && node.type === "Literal" && node.value === null) {
1212
if (node.regex) {
1313
return `/${node.regex.pattern}/${node.regex.flags}`
1414
}

0 commit comments

Comments
 (0)