Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[js] add console.trace when compiling a NYI thing to an expression
  • Loading branch information
pmurias committed Oct 20, 2015
1 parent 5a5939a commit 19e6c40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -2318,7 +2318,7 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
}


return Chunk.new($desired, "coercion($got, $desired, {$chunk.expr})", []) #TODO
return Chunk.new($desired, "nqp.coercion($got, $desired, {$chunk.expr})", []) #TODO
}
$chunk;
}
Expand Down Expand Up @@ -2361,7 +2361,7 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
} elsif $!nyi eq 'warn' {
nqp::printfh(nqp::getstderr(), "NYI: $msg\n");
}
Chunk.new($T_VOID,"NYI({quote_string($msg)})",["console.trace(\"NYI: \"+{quote_string($msg)});\n"]);
Chunk.new($T_VOID,"nqp.NYI({quote_string($msg)})",["console.trace(\"NYI: \"+{quote_string($msg)});\n"]);
#nqp::die("NYI: $msg");
}

Expand Down
4 changes: 4 additions & 0 deletions src/vm/js/nqp-runtime/runtime.js
Expand Up @@ -405,8 +405,12 @@ exports.dumpObj = function(obj) {
seen.push(value);
return value;
}, ' ');
exports.NYI = function(msg) {
console.trace(msg);
return null;
};


exports.args = function(module) {
return require.main === module ? process.argv.slice(1) : [];
};

0 comments on commit 19e6c40

Please sign in to comment.