use std::collections::hash_map::HashMap;
use std::vec::Vec;
use js_types::js_type::{JsType, JsT};

pub type JsProto = Option<Box<JsObj>>;

macro_rules! hash_map {
    ( $( $k:expr => $v:expr),* ) => {{
            let mut temp_hash_map = HashMap::new();
            $(
                temp_hash_map.insert($k, $v);
            )*
            temp_hash_map
    }}
}

pub struct JsObj {
    proto: JsProto,
    dict: HashMap<JsType, JsType>,
}

impl JsT for JsObj {}

impl JsObj {
    pub fn new(proto: JsProto, kv_pairs: Vec<(JsType, JsType)>) -> JsObj {
        let mut obj_map = HashMap::new();
        kv_pairs.into_iter().map(|(k,v)| obj_map.insert(k, v));
        JsObj {
            proto: None,
            dict: obj_map,
        }
    }
}

use std::collections::hash_map::HashMap;
use js_types::js_type::{JsType, JsT};

pub struct JsObj {
    proto: Option<Box<JsObj>>,
    dict: HashMap<JsType, JsType>,
}

impl JsT for JsObj {}

impl JsObj {
    pub fn new() -> JsObj {
        JsObj {
            proto: None,
            dict: HashMap::new(),
        }
    }
}

--- 
+++ 
@@ -1,18 +1,33 @@
 use std::collections::hash_map::HashMap;
+use std::vec::Vec;
 use js_types::js_type::{JsType, JsT};
 
+pub type JsProto = Option<Box<JsObj>>;
+
+macro_rules! hash_map {
+    ( $( $k:expr => $v:expr),* ) => {{
+            let mut temp_hash_map = HashMap::new();
+            $(
+                temp_hash_map.insert($k, $v);
+            )*
+            temp_hash_map
+    }}
+}
+
 pub struct JsObj {
-    proto: Option<Box<JsObj>>,
+    proto: JsProto,
     dict: HashMap<JsType, JsType>,
 }
 
 impl JsT for JsObj {}
 
 impl JsObj {
-    pub fn new() -> JsObj {
+    pub fn new(proto: JsProto, kv_pairs: Vec<(JsType, JsType)>) -> JsObj {
+        let mut obj_map = HashMap::new();
+        kv_pairs.into_iter().map(|(k,v)| obj_map.insert(k, v));
         JsObj {
             proto: None,
-            dict: HashMap::new(),
+            dict: obj_map,
         }
     }
 }
Add JsProto type alias and allow JsObj to take a vec of (k,v) pairs
