Fix for declarations in object literals
Merge pull request #3328 from xixixao/issue3216

Fixes #3216 for declarations in object literals