shim string.prototype.trim locally