From 8d2753c14120e7aef2d4ad1ca0c9dc612c0c9b8b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Nov 2012 16:10:35 +0100 Subject: [PATCH] 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. --- src/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.h b/src/node.h index 0d93d35ec2c..5a246a16077 100644 --- a/src/node.h +++ b/src/node.h @@ -103,7 +103,7 @@ void EmitExit(v8::Handle process); #define NODE_DEFINE_CONSTANT(target, constant) \ (target)->Set(v8::String::NewSymbol(#constant), \ - v8::Integer::New(constant), \ + v8::Number::New(constant), \ static_cast( \ v8::ReadOnly|v8::DontDelete))