Skip to content

Commit

Permalink
Produce a panic if a user incorrectly tries to run Vecty without a br…
Browse files Browse the repository at this point in the history
…owser (e.g. under node) (#181)

Fixes #74
  • Loading branch information
slimsag committed Dec 5, 2017
1 parent 3b33b65 commit 65aacee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 12 additions & 0 deletions dom.go
Expand Up @@ -1268,3 +1268,15 @@ func (w wrappedObject) Float() float64 {
}

var isTest bool

func init() {
if isTest {
return
}
if global == nil {
panic("vecty: only GopherJS compiler is supported")
}
if global.Get("document") == undefined {
panic("vecty: only running inside a browser is supported")
}
}
10 changes: 0 additions & 10 deletions gopherjs_only.go

This file was deleted.

0 comments on commit 65aacee

Please sign in to comment.