contextify: use CHECK instead of `if`

I was walking through the vm changes and saw this particular `if` check
interesting. In case `ctx` is empty it's going to fail later anyways.
So, instead of putting an `if` check there;

option a - use CHECK
option b - do nothing

Considering the developer wanted to make sure `ctx` is not empty,
`CHECK` option looked more convenient.

PR-URL: https://github.com/nodejs/node/pull/3125
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
pull/3139/merge
Oguz Bastemur 2015-09-30 07:02:12 +02:00 committed by Ben Noordhuis
parent 07a43eb129
commit e83499ae62
1 changed files with 3 additions and 2 deletions

View File

@ -216,7 +216,8 @@ class ContextifyContext {
object_template->SetHandler(config);
Local<Context> ctx = Context::New(env->isolate(), nullptr, object_template);
if (!ctx.IsEmpty())
CHECK(!ctx.IsEmpty());
ctx->SetSecurityToken(env->context()->GetSecurityToken());
env->AssignToContext(ctx);