Browse Source

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.
v0.9.4-release
Ben Noordhuis 12 years ago
parent
commit
8d2753c141
  1. 2
      src/node.h

2
src/node.h

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

Loading…
Cancel
Save