Bug 992958 - More stylistics fixups. r=me

This commit is contained in:
Bobby Holley 2014-05-23 16:53:04 -07:00
parent e5a3ce4afd
commit 4c374c2cb1
2 changed files with 8 additions and 4 deletions

View File

@ -614,11 +614,11 @@ CreateFunctionConstructor(JSContext *cx, JSProtoKey key)
self, SingletonObject));
if (!ctor)
return nullptr;
RootedAtom functionAtom(cx, cx->names().Function);
RootedObject functionCtor(cx, NewFunction(cx, ctor, Function, 1, JSFunction::NATIVE_CTOR, self,
functionAtom));
HandlePropertyName(cx->names().Function)));
if (!functionCtor)
return nullptr;
JS_ASSERT(ctor == functionCtor);
return functionCtor;
@ -633,6 +633,7 @@ CreateFunctionPrototype(JSContext *cx, JSProtoKey key)
objectProto, self, SingletonObject);
if (!functionProto_)
return nullptr;
RootedFunction functionProto(cx, &functionProto_->as<JSFunction>());
/*
@ -644,6 +645,7 @@ CreateFunctionPrototype(JSContext *cx, JSProtoKey key)
self, js::NullPtr());
if (!proto)
return nullptr;
JS_ASSERT(proto == functionProto);
functionProto->setIsFunctionPrototype();
}
@ -653,6 +655,7 @@ CreateFunctionPrototype(JSContext *cx, JSProtoKey key)
jschar *source = InflateString(cx, rawSource, &sourceLen);
if (!source)
return nullptr;
ScriptSource *ss =
cx->new_<ScriptSource>();
if (!ss) {
@ -683,6 +686,7 @@ CreateFunctionPrototype(JSContext *cx, JSProtoKey key)
types::TypeObject* protoType = functionProto->getType(cx);
if (!protoType)
return nullptr;
protoType->interpretedFunction = functionProto;
script->setFunction(functionProto);

View File

@ -78,6 +78,7 @@ CreateObjectConstructor(JSContext *cx, JSProtoKey key)
Rooted<GlobalObject*> self(cx, cx->global());
if (!GlobalObject::ensureConstructor(cx, self, JSProto_Function))
return nullptr;
RootedObject functionProto(cx, &self->getPrototype(JSProto_Function).toObject());
/* Create the Object function now that we have a [[Prototype]] for it. */
@ -85,9 +86,8 @@ CreateObjectConstructor(JSContext *cx, JSProtoKey key)
self, SingletonObject));
if (!ctor)
return nullptr;
RootedAtom objectAtom(cx, cx->names().Object);
return NewFunction(cx, ctor, obj_construct, 1, JSFunction::NATIVE_CTOR, self,
objectAtom);
HandlePropertyName(cx->names().Object));
}
static JSObject *