Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 949f4db

Browse files
committed
remove Empty value.
With the Maybe apis in use everywhere, it won't be necessary anymore.
1 parent 6331efc commit 949f4db

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

ext/v8/value.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
namespace rr {
44

5-
VALUE Value::Empty;
6-
75
void Value::Init() {
8-
Empty = rb_eval_string("Object.new");
9-
106
ClassBuilder("Value").
11-
defineConst("Empty", Empty).
12-
137
defineMethod("IsUndefined", &IsUndefined).
148
defineMethod("IsNull", &IsNull).
159
defineMethod("IsTrue", &IsTrue).
@@ -44,8 +38,6 @@ namespace rr {
4438
defineSingletonMethod("FromRubyObject", &FromRubyObject).
4539

4640
store(&Class);
47-
48-
rb_gc_register_address(&Empty);
4941
}
5042

5143
VALUE Value::IsUndefined(VALUE self) {
@@ -209,10 +201,6 @@ namespace rr {
209201
}
210202

211203
v8::Handle<v8::Value> Value::rubyObjectToHandle(v8::Isolate* isolate, VALUE value) {
212-
if (rb_equal(value, Empty)) {
213-
return v8::Handle<v8::Value>();
214-
}
215-
216204
switch (TYPE(value)) {
217205
case T_FIXNUM:
218206
return v8::Integer::New(isolate, NUM2INT(value));

ext/v8/value.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ namespace rr {
6666
static v8::Handle<v8::Value> rubyObjectToHandle(v8::Isolate* isolate, VALUE value);
6767

6868
static std::vector< v8::Handle<v8::Value> > convertRubyArray(v8::Isolate* isolate, VALUE value);
69-
70-
static VALUE Empty;
7169
};
7270

7371
}

0 commit comments

Comments
 (0)