| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fba2f9a commit 592d51c
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,6 +116,7 @@ HandleWrap::HandleWrap(Environment* env, | |||
| 116 | 116 | handle_(handle) { | |
| 117 | 117 | handle_->data = this; | |
| 118 | 118 | HandleScope scope(env->isolate()); | |
| 119 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 119 | 120 | env->handle_wrap_queue()->PushBack(this); | |
| 120 | 121 | } | |
| 121 | 122 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -344,7 +344,8 @@ MaybeLocal<Value> Environment::RunBootstrapping() { | |||
| 344 | 344 | ||
| 345 | 345 | // Make sure that no request or handle is created during bootstrap - | |
| 346 | 346 | // if necessary those should be done in pre-execution. | |
| 347 | - // TODO(joyeecheung): print handles/requests before aborting | ||
| 347 | + // Usually, doing so would trigger the checks present in the ReqWrap and | ||
| 348 | + // HandleWrap classes, so this is only a consistency check. | ||
| 348 | 349 | CHECK(req_wrap_queue()->IsEmpty()); | |
| 349 | 350 | CHECK(handle_wrap_queue()->IsEmpty()); | |
| 350 | 351 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -272,6 +272,7 @@ Maybe<bool> KVStore::AssignFromObject(Local<Context> context, | |||
| 272 | 272 | static void EnvGetter(Local<Name> property, | |
| 273 | 273 | const PropertyCallbackInfo<Value>& info) { | |
| 274 | 274 | Environment* env = Environment::GetCurrent(info); | |
| 275 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 275 | 276 | if (property->IsSymbol()) { | |
| 276 | 277 | return info.GetReturnValue().SetUndefined(); | |
| 277 | 278 | } | |
@@ -287,6 +288,7 @@ static void EnvSetter(Local<Name> property, | |||
| 287 | 288 | Local<Value> value, | |
| 288 | 289 | const PropertyCallbackInfo<Value>& info) { | |
| 289 | 290 | Environment* env = Environment::GetCurrent(info); | |
| 291 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 290 | 292 | // calling env->EmitProcessEnvWarning() sets a variable indicating that | |
| 291 | 293 | // warnings have been emitted. It should be called last after other | |
| 292 | 294 | // conditions leading to a warning have been met. | |
@@ -320,6 +322,7 @@ static void EnvSetter(Local<Name> property, | |||
| 320 | 322 | static void EnvQuery(Local<Name> property, | |
| 321 | 323 | const PropertyCallbackInfo<Integer>& info) { | |
| 322 | 324 | Environment* env = Environment::GetCurrent(info); | |
| 325 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 323 | 326 | if (property->IsString()) { | |
| 324 | 327 | int32_t rc = env->env_vars()->Query(env->isolate(), property.As<String>()); | |
| 325 | 328 | if (rc != -1) info.GetReturnValue().Set(rc); | |
@@ -329,6 +332,7 @@ static void EnvQuery(Local<Name> property, | |||
| 329 | 332 | static void EnvDeleter(Local<Name> property, | |
| 330 | 333 | const PropertyCallbackInfo<Boolean>& info) { | |
| 331 | 334 | Environment* env = Environment::GetCurrent(info); | |
| 335 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 332 | 336 | if (property->IsString()) { | |
| 333 | 337 | env->env_vars()->Delete(env->isolate(), property.As<String>()); | |
| 334 | 338 | } | |
@@ -340,6 +344,7 @@ static void EnvDeleter(Local<Name> property, | |||
| 340 | 344 | ||
| 341 | 345 | static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) { | |
| 342 | 346 | Environment* env = Environment::GetCurrent(info); | |
| 347 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 343 | 348 | ||
| 344 | 349 | info.GetReturnValue().Set( | |
| 345 | 350 | env->env_vars()->Enumerate(env->isolate())); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ | |||
| 10 | 10 | namespace node { | |
| 11 | 11 | ||
| 12 | 12 | ReqWrapBase::ReqWrapBase(Environment* env) { | |
| 13 | + CHECK(env->has_run_bootstrapping_code()); | ||
| 13 | 14 | env->req_wrap_queue()->PushBack(this); | |
| 14 | 15 | } | |
| 15 | 16 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments