Basic example of scala-js pickling -
i'm trying understand absolute basic of utilize of scala-js pickling, there obvious missing.
i thought along below should work:
package tst import org.scalajs.spickling._ import org.scalajs.spickling.jsany._ object rh { case class test(message:string) picklerregistry.register[test] def main(args: array[string]) { picklerregistry.pickle(test("xxx")) } }
but when run above backtrace saying:
exception in thread "main" java.lang.runtimeexception: stub @ scala.sys.package$.error(package.scala:27) @ scala.scalajs.js.any$.fromstring(primitives.scala:48) @ org.scalajs.spickling.jsany.jspbuilder$.makestring(jspbuilderreader.scala:10) @ org.scalajs.spickling.jsany.jspbuilder$.makestring(jspbuilderreader.scala:6) @ org.scalajs.spickling.pickler$stringpickler$.pickle(pickler.scala:58) @ org.scalajs.spickling.pickler$stringpickler$.pickle(pickler.scala:56) @ org.scalajs.spickling.basepicklerregistry.pickle(picklerregistry.scala:60) @ tutorial.webapp.rh$genpickler$2$.pickle(rh.scala:10) @ tutorial.webapp.rh$genpickler$2$.pickle(rh.scala:10) @ org.scalajs.spickling.basepicklerregistry.pickle(picklerregistry.scala:60) @ tst.rh$.main(rh.scala:13) @ tst.rh.main(rh.scala)
any clues have been missing here?
scala scala-pickling
No comments:
Post a Comment