mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
don't use integer conversions. All JS Numbers are internally represented as 64bit doubles anyway.
This commit is contained in:
parent
62ff07719f
commit
42507e4daf
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ VALUE rr_v82rb(int32_t value) {
|
||||||
Handle<Value> rr_rb2v8(VALUE value) {
|
Handle<Value> rr_rb2v8(VALUE value) {
|
||||||
switch (TYPE(value)) {
|
switch (TYPE(value)) {
|
||||||
case T_FIXNUM:
|
case T_FIXNUM:
|
||||||
return Integer::New(FIX2LONG(value));
|
// TODO: use this conversion if value will fit in 32 bits.
|
||||||
|
// return Integer::New(FIX2LONG(value));
|
||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
return Number::New(NUM2DBL(value));
|
return Number::New(NUM2DBL(value));
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue