avoid the case that "hasAmbient" use before assign
Merge pull request #170 from tangziwen/v3

avoid the case that "hasAmbient" use before assign
Merge pull request #9359 from super626/v3

Initialize variable when defined