Commits

jer...@jeremylatt.com  committed 2e55bbb

handle nulls correctly

  • Participants
  • Parent commits c99c9d6

Comments (0)

Files changed (3)

 # compile
 CPP      = g++
 CFLAGS   = -Iinclude -I$(V8_INC) -I$(ERL_INC) -g -c -Wall
-LFLAGS   = -dynamiclib -flat_namespace -undefined suppress -L$(V8_ROOT) -lv8_g -Wall -fPIC
+LFLAGS   = -Wall -fPIC -dynamiclib -flat_namespace -undefined suppress -L$(V8_ROOT) -lv8_g
 CPPSRCS  = $(wildcard src/*.cc)
 CPPOBJS  = $(patsubst %.cc,%.o,$(CPPSRCS))
 
+true;

File src/js2erl.cc

   HandleScope scope;
   if (val->IsObject()) {
     Handle<Object> obj = Handle<Object>::Cast(val);
-    if (val->IsArray()) {
+    if (val->IsNull()) {
+      return atom("null", terms);
+    } else if (val->IsArray()) {
       return array_to_terms(Handle<Array>::Cast(obj), terms);
     } else if (val->IsDate()) {
       return date_to_terms(Handle<Date>::Cast(obj), terms);