src: distinguish env stopping flags
Currently, !env->can_call_into_js()
and env->is_stopping()
have different semantics by their names. The is_stopping()
flag implies !env->can_call_into_js()
.
However, this implication is not enforced in Environment::FreeEnvironment
. Environment::FreeEnvironment
creates a DisallowJavascriptExecutionScope
, the flag Environment::can_call_into_js()
needs to be set as false
.
As Environment::can_call_into_js_
is a simple boolean flag, it should not be accessed off-thread. This also fixes an issue that the flag Environment::can_call_into_js_
is been modified in Environment::ExitEnv
, which may be called from other threads.