If I understand correctly, this isn't necessary with cpg. Is that right Brian?
I think this check is still necessary for objects in non-compileAndGo scripts, as the initial shape of the object is derived from the script's bindings and those bindings will have a NULL parent for non-CNG scripts. Of course, with CPG there is no sense in distinguishing CNG vs. non-CNG scripts (given special handling for scripts which can run against non-global, non-scope scopes) so the CNG vs. non-CNG distinction should be removed itself.
To be clear, as is the check does not need to be performed for call objects created in compileAndGo code.
Ohh, I see. I didn't realize the role TypeScript::SetScope played in all this. Gross, so we can rip out pretty much all that stuff with CNG.