JavaScript Services

From WebOS Internals
Revision as of 15:45, 13 October 2014 by Reeder.29 (talk | contribs)
Jump to navigation Jump to search

Some notes to flesh out the primary documentation

Node versions

  • webOS 1.x: node not present
  • webOS 2.x: node v0.2.3
  • webOS 3.0: node v0.4.12
  • webOS TV: ?
  • LuneOS (webOS 3.5): node v0.10.25


Values returned over the PalmBus

To return a success, set future.result to an object with the desired properties (where future is the future passed to the Command Assistant).

To return a failure, set future.exception to an object (often some kind of Error). Best practice is to set both message and errorCode properties.

(If you set the errorCode property of the object, that will be the errorCode returned over PalmBus, and the errorText will be copied from the message property. Otherwise, errorCode will be -9999 and errorText will be "MojoService: no errorCode supplied "+(reply.errorText||""))


While the Command Assistant run() method is called "inside" the future, it's not clear that you can compose the passed future with others.