Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix existspos, pass test 59.
  • Loading branch information
pmurias committed Dec 1, 2014
1 parent 46678fd commit b97120f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vm/js/bin/run_tests
@@ -1,5 +1,5 @@
#!/bin/bash
# 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped
#echo 'No tests pass as we are in the early stages of a rewrite/refactor'
prove -e './nqp-js' t/nqp/{01..17}* t/nqp/{20,22,23,25,36,37,38,40,41,42,46,48,53,63,68,81,83}* t/js/getcomp-js.t
prove -e './nqp-js' t/nqp/{01..17}* t/nqp/{20,22,23,25,36,37,38,40,41,42,46,48,53,59,63,68,81,83}* t/js/getcomp-js.t
#prove -e './nqp-js' t/nqp/{01..29}*.t t/nqp/{31..48}* t/nqp/{50,51,53}* t/nqp/{55..81}* t/nqp/83* t/serialization/0{2,3}*.t
2 changes: 1 addition & 1 deletion src/vm/js/nqp-runtime/core.js
Expand Up @@ -162,7 +162,7 @@ exports.op.ishash = function(obj) {

op.existspos = function(array, idx) {
if (idx < 0) idx += array.length;
return boolish(array.hasOwnProperty(idx));
return array.hasOwnProperty(idx) ? 1 : 0;
};

op.create = function(obj) {
Expand Down
2 changes: 2 additions & 0 deletions src/vm/js/nqp-runtime/runtime.js
Expand Up @@ -50,6 +50,8 @@ exports.to_str = function(arg) {
return arg.toString();
} else if (typeof arg == 'string') {
return arg;
} else if (arg.type_object_) {
return "";
} else {
console.log(arg);
throw "Can't convert to str";
Expand Down

0 comments on commit b97120f

Please sign in to comment.