Bug 656810 - Implement js::NumberObject. r=njn

This commit is contained in:
Jeff Walden
2011-05-13 14:12:15 -07:00
parent 1e07b402fd
commit 7aa410de9e
5 changed files with 178 additions and 4 deletions

View File

@@ -84,6 +84,7 @@
#include "jsobjinlines.h"
#include "jsstrinlines.h"
#include "vm/NumberObject-inl.h"
#include "vm/String-inl.h"
using namespace js;
@@ -1111,7 +1112,7 @@ js_InitNumberClass(JSContext *cx, JSObject *obj)
JSObject *numberProto = global->createBlankPrototype(cx, &NumberClass);
if (!numberProto)
return NULL;
numberProto->setPrimitiveThis(Int32Value(0));
numberProto->asNumber()->setPrimitiveValue(0);
JSFunction *ctor = global->createConstructor(cx, Number, &NumberClass,
CLASS_ATOM(cx, Number), 1);