fix ReferenceError in browsers

Signed-off-by: Dmitry Kryuchkov <xelibrion@gmail.com>