workaround an issue when compiled to JS

@dinhviethoa