From 27a1fa43913bf397492414d5bdbc001d7ef34420 Mon Sep 17 00:00:00 2001 From: maharsh312 Date: Sat, 26 May 2018 00:21:32 +0530 Subject: [PATCH] Bug 1463645 - Removed unnecessary upcast and downcast of JSFunction r=arai --- js/src/vm/JSFunction.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/js/src/vm/JSFunction.cpp b/js/src/vm/JSFunction.cpp index 0e04c193639b..a6cfda19410d 100644 --- a/js/src/vm/JSFunction.cpp +++ b/js/src/vm/JSFunction.cpp @@ -835,14 +835,11 @@ CreateFunctionPrototype(JSContext* cx, JSProtoKey key) * give it the guts to be one. */ RootedObject enclosingEnv(cx, &self->lexicalEnvironment()); - JSObject* functionProto_ = - NewFunctionWithProto(cx, nullptr, 0, JSFunction::INTERPRETED, - enclosingEnv, nullptr, objectProto, AllocKind::FUNCTION, - SingletonObject); - if (!functionProto_) - return nullptr; - - RootedFunction functionProto(cx, &functionProto_->as()); + RootedFunction functionProto(cx, NewFunctionWithProto(cx, nullptr, 0, JSFunction::INTERPRETED, + enclosingEnv, nullptr, objectProto, + AllocKind::FUNCTION, SingletonObject)); + if (!functionProto) + return nullptr; const char* rawSource = "function () {\n}"; size_t sourceLen = strlen(rawSource);