Make |GrammarError| require work also in the browser version

Fixes a bug from ac179cda7bae7bef539d235e3f66e5eed92b50ef (a fix for
GH-135).