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

export getJSVal from Data.JSString #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 8, 2017

  1. export getJSVal from Data.JSString

    Since `JSString` is just a newtype wrapper, and because JS is unityped, `getJSVal` should always be safe (or at least no *less* safe than the way it was generated in the first place). Furthermore, being able to treat a `JSString` as a `JSVal` is often important in FFI code, as many JS functions can accept multiple "types" of values.
    
    The alternative is to use `unsafeCoerce` which is not super great. Also the function is defined but not used anywhere here or exported, so why not export it...
    adnelson authored Nov 8, 2017
    Configuration menu
    Copy the full SHA
    c46a274 View commit details
    Browse the repository at this point in the history