We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Date
ctx = MiniRacer::Context.new ctx.eval("var foo = function (obj) { console.log(obj); }") ctx.call("foo", { my_date: Date.today }) # JS logs => "{ my_date: "Undefined Conversion" }"
DateTime and Time both work fine. Looks like Date falls into the default case here: https://github.com/discourse/mini_racer/blob/b3c9b35859deb189586384f3ae927586a36dda14/ext/mini_racer_extension/mini_racer_extension.cc#L528
DateTime
Time
The text was updated successfully, but these errors were encountered:
This may be fixed by #128 since it looks like it falls back to to_s before Undefined conversion
to_s
Undefined conversion
At least partially so as js would get the value in string form (rather than a date obj)
Sorry, something went wrong.
Can confirm with 0.6.2. The nesting does not seem to be required, it also doesn't work when directly passing a Date object:
require "mini_racer" require "date" ctx = MiniRacer::Context.new ctx.eval("var echoFn = (obj) => obj;") ctx.call("echoFn", Date.today) # => "Undefined Conversion"
@awinograd Out of curiosity: How do you access the "JS logs" with MiniRacer? 🤔
@SamSaffron Am I right to assume this is a bug? Also, is there an overview on how types get translated in both directions?
I would say it is kind of on the feature side of things vs bug, there is a missing conversion internally in the ruby2js part.
We should get this sorted though, agree. We should stop treating it as a string.
No branches or pull requests
DateTime
andTime
both work fine. Looks likeDate
falls into the default case here: https://github.com/discourse/mini_racer/blob/b3c9b35859deb189586384f3ae927586a36dda14/ext/mini_racer_extension/mini_racer_extension.cc#L528The text was updated successfully, but these errors were encountered: