[#2255] Add code generation option to avoid the generation of
"global object references"