mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
map js(undefined) -> ruby(nil)
This commit is contained in:
parent
693a42b5d4
commit
5a45899135
2 changed files with 5 additions and 2 deletions
|
@ -13,7 +13,6 @@ describe "The Ruby Racer" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "passes back undefined value as nil" do
|
it "passes back undefined value as nil" do
|
||||||
pending "This currently causes a segmentation fault..."
|
|
||||||
eval("this.undefined").should be_nil
|
eval("this.undefined").should be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,14 @@ template<class T, class R> class V8HandleSource {
|
||||||
|
|
||||||
R push(v8::Handle<v8::Value>& value, const char* name = 0) {
|
R push(v8::Handle<v8::Value>& value, const char* name = 0) {
|
||||||
|
|
||||||
if(value->IsNull()) {
|
if (value->IsUndefined()) {
|
||||||
return dest.pushNull(name);
|
return dest.pushNull(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(value->IsNull()) {
|
||||||
|
return dest.pushNull(name);
|
||||||
|
}
|
||||||
|
|
||||||
if(value->IsTrue()) {
|
if(value->IsTrue()) {
|
||||||
return dest.pushBool(true, name);
|
return dest.pushBool(true, name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue