From 54cbc623fb9f25d971d05f5a32261ab73712ce2f Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 6 Mar 2012 11:02:36 -0500 Subject: [PATCH] trying to trace why we're getting fractional --- image/private/js-impl.js | 3 ++- js-assembler/runtime-src/runtime.js | 4 ++-- tests/clipart-test/clipart.rkt | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/image/private/js-impl.js b/image/private/js-impl.js index b3bdcf3..f000d0a 100644 --- a/image/private/js-impl.js +++ b/image/private/js-impl.js @@ -1080,5 +1080,6 @@ EXPORTS['name->color'] = 1, function(MACHINE) { var name = checkSymbolOrString(MACHINE, 'name->color', 0); - return colorDb.get('' + name) || false; + var result = colorDb.get('' + name) || false; + return result; }); \ No newline at end of file diff --git a/js-assembler/runtime-src/runtime.js b/js-assembler/runtime-src/runtime.js index ad96f2c..374fa0f 100644 --- a/js-assembler/runtime-src/runtime.js +++ b/js-assembler/runtime-src/runtime.js @@ -1075,7 +1075,7 @@ if (i >= 0 && i < vec.elts.length) { return vec.elts[i]; } - } else if (isNumber(i)) { + } else if (isNatural(i)) { i = baselib.numbers.toFixnum(i); if (i >= 0 && i < vec.elts.length) { return vec.elts[i]; @@ -1098,7 +1098,7 @@ vec.elts[i] = val; return VOID; } - } else if (isNumber(i)) { + } else if (isNatural(i)) { i = baselib.numbers.toFixnum(i); if (i >= 0 && i < vec.elts.length) { vec.elts[i] = val; diff --git a/tests/clipart-test/clipart.rkt b/tests/clipart-test/clipart.rkt index 5ddcae0..f8b86e3 100644 --- a/tests/clipart-test/clipart.rkt +++ b/tests/clipart-test/clipart.rkt @@ -35,6 +35,7 @@ (define (color-connected-points! imgvec width height start-color destination-color tolerance it) (let ((mycol (vector-ref imgvec it))) + (printf "~a ~a\n" mycol it) (when (and (not (color=? mycol destination-color)) (color-near? mycol start-color tolerance)) (begin