mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
add guards to satisfy v8 assertions
This commit is contained in:
parent
59154c2e2b
commit
e038c0c301
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ namespace rr {
|
||||||
this->deleter = unwrap(wrapper, 3);
|
this->deleter = unwrap(wrapper, 3);
|
||||||
this->enumerator = unwrap(wrapper, 4);
|
this->enumerator = unwrap(wrapper, 4);
|
||||||
v8::Handle<v8::Value> data = wrapper->Get(5);
|
v8::Handle<v8::Value> data = wrapper->Get(5);
|
||||||
if (!data.IsEmpty()) {
|
if (!data.IsEmpty() && !data->IsNull() && !data->IsUndefined()) {
|
||||||
this->data = Value(data);
|
this->data = Value(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace rr {
|
||||||
|
|
||||||
VALUE Accessor::unwrap(v8::Handle<v8::Object> wrapper, int index) {
|
VALUE Accessor::unwrap(v8::Handle<v8::Object> wrapper, int index) {
|
||||||
v8::Handle<v8::Value> value = wrapper->Get(index);
|
v8::Handle<v8::Value> value = wrapper->Get(index);
|
||||||
if (value.IsEmpty()) {
|
if (value.IsEmpty() || !value->IsExternal()) {
|
||||||
return Qnil;
|
return Qnil;
|
||||||
} else {
|
} else {
|
||||||
v8::Handle<v8::External> external(v8::External::Cast(*value));
|
v8::Handle<v8::External> external(v8::External::Cast(*value));
|
||||||
|
|
Loading…
Reference in a new issue