ui: Refactoring: Use IsNodeJS

This commit is contained in:
Hajime Hoshi 2018-05-16 22:02:33 +09:00
parent 176b80cc83
commit c2df8326fc

View File

@ -25,6 +25,7 @@ import (
"github.com/hajimehoshi/ebiten/internal/devicescale" "github.com/hajimehoshi/ebiten/internal/devicescale"
"github.com/hajimehoshi/ebiten/internal/input" "github.com/hajimehoshi/ebiten/internal/input"
"github.com/hajimehoshi/ebiten/internal/opengl" "github.com/hajimehoshi/ebiten/internal/opengl"
"github.com/hajimehoshi/ebiten/internal/web"
) )
var canvas *js.Object var canvas *js.Object
@ -216,7 +217,7 @@ func init() {
func initialize() error { func initialize() error {
// Do nothing in node.js. // Do nothing in node.js.
if js.Global.Get("require") != js.Undefined { if web.IsNodeJS() {
return nil return nil
} }