mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
Use equivalence classe for integer conversion
This commit is contained in:
parent
7f659ef385
commit
08c458174c
6 changed files with 8 additions and 8 deletions
|
@ -16,7 +16,7 @@ VALUE Array::New(int argc, VALUE argv[], VALUE self) {
|
|||
}
|
||||
|
||||
VALUE Array::Length(VALUE self) {
|
||||
return UINT2NUM(Array(self)->Length());
|
||||
return UInt32(Array(self)->Length());
|
||||
}
|
||||
|
||||
VALUE Array::CloneElementAt(VALUE self, VALUE index) {
|
||||
|
|
|
@ -43,11 +43,11 @@ namespace rr {
|
|||
}
|
||||
|
||||
VALUE Function::GetScriptLineNumber(VALUE self) {
|
||||
return INT2FIX(Function(self)->GetScriptLineNumber());
|
||||
return Int(Function(self)->GetScriptLineNumber());
|
||||
}
|
||||
|
||||
VALUE Function::GetScriptColumnNumber(VALUE self) {
|
||||
return INT2FIX(Function(self)->GetScriptColumnNumber());
|
||||
return Int(Function(self)->GetScriptColumnNumber());
|
||||
}
|
||||
|
||||
VALUE Function::GetScriptId(VALUE self) {
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace rr {
|
|||
}
|
||||
|
||||
VALUE Invocation::Arguments::Length(VALUE self) {
|
||||
return INT2FIX(Arguments(self)->Length());
|
||||
return Int(Arguments(self)->Length());
|
||||
}
|
||||
|
||||
VALUE Invocation::Arguments::Get(VALUE self, VALUE index) {
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace rr {
|
|||
return *this;
|
||||
}
|
||||
ClassBuilder& ClassBuilder::defineEnumConst(const char* name, int value) {
|
||||
rb_define_const(this->value, name, INT2FIX(value));
|
||||
rb_define_const(this->value, name, Int(value));
|
||||
return *this;
|
||||
}
|
||||
ClassBuilder& ClassBuilder::store(VALUE* storage) {
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace rr {
|
|||
}
|
||||
|
||||
VALUE ObjectTemplate::InternalFieldCount(VALUE self) {
|
||||
return INT2FIX(ObjectTemplate(self)->InternalFieldCount());
|
||||
return Int(ObjectTemplate(self)->InternalFieldCount());
|
||||
}
|
||||
|
||||
VALUE ObjectTemplate::SetInternalFieldCount(VALUE self, VALUE count) {
|
||||
|
|
|
@ -31,10 +31,10 @@ Value::operator VALUE() {
|
|||
return External((v8::Handle<v8::External>)v8::External::Cast(*handle));
|
||||
}
|
||||
if (handle->IsUint32()) {
|
||||
return UINT2NUM(handle->Uint32Value());
|
||||
return UInt32(handle->Uint32Value());
|
||||
}
|
||||
if (handle->IsInt32()) {
|
||||
return INT2FIX(handle->Int32Value());
|
||||
return Int(handle->Int32Value());
|
||||
}
|
||||
if (handle->IsBoolean()) {
|
||||
return handle->BooleanValue() ? Qtrue : Qfalse;
|
||||
|
|
Loading…
Reference in a new issue