aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-15 01:24:43 -0500
committerJoel Martin <github@martintribe.org>2014-04-15 01:24:43 -0500
commit7e9a2883fe5c25a521b1dc37e4c549e1ed508ece (patch)
treeb444224dae6db978d4b5902f2a5b37046ba40d3e /js
parenta2849f89e7892feee256169398b1d2d82a2b8231 (diff)
downloadmal-7e9a2883fe5c25a521b1dc37e4c549e1ed508ece.tar.gz
mal-7e9a2883fe5c25a521b1dc37e4c549e1ed508ece.zip
All: fix get. All pass stepA tests.
Diffstat (limited to 'js')
-rw-r--r--js/core.js2
-rw-r--r--js/step2_eval.js1
-rw-r--r--js/step3_env.js1
-rw-r--r--js/step4_if_fn_do.js1
4 files changed, 4 insertions, 1 deletions
diff --git a/js/core.js b/js/core.js
index b8b0062..7addc49 100644
--- a/js/core.js
+++ b/js/core.js
@@ -51,7 +51,7 @@ function dissoc(src_hm) {
}
function get(hm, key) {
- if (key in hm) {
+ if (hm != null && key in hm) {
return hm[key];
} else {
return null;
diff --git a/js/step2_eval.js b/js/step2_eval.js
index f111a58..adcefe5 100644
--- a/js/step2_eval.js
+++ b/js/step2_eval.js
@@ -32,6 +32,7 @@ function eval_ast(ast, env) {
}
function _EVAL(ast, env) {
+ //printer.println("EVAL:", types._pr_str(ast, true));
if (!types._list_Q(ast)) {
return eval_ast(ast, env);
}
diff --git a/js/step3_env.js b/js/step3_env.js
index 1000437..86981d2 100644
--- a/js/step3_env.js
+++ b/js/step3_env.js
@@ -33,6 +33,7 @@ function eval_ast(ast, env) {
}
function _EVAL(ast, env) {
+ //printer.println("EVAL:", types._pr_str(ast, true));
if (!types._list_Q(ast)) {
return eval_ast(ast, env);
}
diff --git a/js/step4_if_fn_do.js b/js/step4_if_fn_do.js
index 0bf988d..a80190e 100644
--- a/js/step4_if_fn_do.js
+++ b/js/step4_if_fn_do.js
@@ -34,6 +34,7 @@ function eval_ast(ast, env) {
}
function _EVAL(ast, env) {
+ //printer.println("EVAL:", types._pr_str(ast, true));
if (!types._list_Q(ast)) {
return eval_ast(ast, env);
}