constants: fix wrapping of large constants

Use Number::New() instead of Integer::New(). The latter wraps large values,
e.g. 0x80000000 becomes -2147483648 instead of 2147483648.
This commit is contained in:
Ben Noordhuis 2012-11-22 16:10:35 +01:00
parent 11a5119e72
commit 8d2753c141

View File

@ -103,7 +103,7 @@ void EmitExit(v8::Handle<v8::Object> process);
#define NODE_DEFINE_CONSTANT(target, constant) \
(target)->Set(v8::String::NewSymbol(#constant), \
v8::Integer::New(constant), \
v8::Number::New(constant), \
static_cast<v8::PropertyAttribute>( \
v8::ReadOnly|v8::DontDelete))