Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index a61ec90c304c67e82267509204a13803a02c7503..ce506ce7746e94443d773e3b736dbe2bd8ccd8d4 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -8869,7 +8869,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewGlobalContext) { |
ASSERT(function->context() == isolate->context()); |
ASSERT(function->context()->global_object() == result->global_object()); |
- isolate->set_context(result); |
result->global_object()->set_global_context(result); |
return result; // non-failure |
@@ -8882,14 +8881,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewFunctionContext) { |
CONVERT_ARG_CHECKED(JSFunction, function, 0); |
int length = function->shared()->scope_info()->ContextLength(); |
- Context* result; |
- MaybeObject* maybe_result = |
- isolate->heap()->AllocateFunctionContext(length, function); |
- if (!maybe_result->To(&result)) return maybe_result; |
- |
- isolate->set_context(result); |
- |
- return result; // non-failure |
+ return isolate->heap()->AllocateFunctionContext(length, function); |
} |