[js] do not generate block-level TObjectDecl, instead treat the fields as block expressions (closes #3440)