Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Commit c319b2b

Browse files
author
Justin Holguin
committed
Allow document to be undefined for REPL support
Previously, attempting to start elm-repl for a module that depends on Navigation would fail because `document` was undefined. This commit uses a dummy (empty object) value for the offending reference, preventing a crash.
1 parent a539ec5 commit c319b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Native/Navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function setLocation(url)
6868

6969
function getLocation()
7070
{
71-
var location = document.location;
71+
var location = (typeof document !== 'undefined') ? document.location : {};
7272

7373
return {
7474
href: location.href,

0 commit comments

Comments
 (0)