Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call String.prototype.trim (or any other prototype function) as shown in the documentation example? #1748

Open
4 tasks done
tbinna opened this issue May 7, 2021 · 2 comments

Comments

@tbinna
Copy link

tbinna commented May 7, 2021

Before filing issues, please check the following points first:

This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.

I have been trying the example from the docs calling String.prototype.trim to work, but it does not seem to return the desired result (https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access).

https://jsfiddle.net/3yahoj1d/

Can anyone explain why the result prints as [object Object] to the console when typeof result returns string, or how to get the example to work?

I have also asked this on StackOverflow (https://stackoverflow.com/q/67416982/5115898) so feel free to close this issue if this is not a problem with handlebars itself.

@aalimovs
Copy link

Got here the same way, followed documentation's example which didn't work -> StackOverflow -> here.

@tbinna have you had any luck since creating the issue?

@aalimovs
Copy link

@tbinna nevermind, added pull request to fix #1958

jaylinski pushed a commit to aalimovs/handlebars.js that referenced this issue Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants