Does Enum.vals() exist in Javascript land? I seem to get an error:
Enum.vals()
sys::Err: fan.sys.Month.vals is not a function
If not, how would I get a Month instance from an ordinal so I can create a DateTime instance?
Month
DateTime
Note I'm trying to call from within Javascript - console.info( fan.sys.Month.vals() )
console.info( fan.sys.Month.vals() )
Some digging in sys.js gives me:
sys.js
fan.sys.Month.m_vals
Which I can use like this:
var d = fan.sys.DateTime.make(2018, fan.sys.Month.m_vals.get(8), 16);
Still, it may be nice to expose a static vals() method, no?
vals()
Yep -- compilerJs optimizes to a field access when it can
Login or Signup to reply.
SlimerDude Thu 16 Aug 2018
Does
Enum.vals()
exist in Javascript land? I seem to get an error:If not, how would I get a
Month
instance from an ordinal so I can create aDateTime
instance?Note I'm trying to call from within Javascript -
console.info( fan.sys.Month.vals() )
SlimerDude Thu 16 Aug 2018
Some digging in
sys.js
gives me:Which I can use like this:
Still, it may be nice to expose a static
vals()
method, no?andy Thu 16 Aug 2018
Yep -- compilerJs optimizes to a field access when it can