jetpack: convert entry into a JS string

(integrated from trunk branch change 6ed14ac by Todd Whiteman <toddw@activestate.com>)