Issue 133 js compile error v1

New patch for issue #133
@whimboo: r?