✨ own stringify
helper
This commit is contained in:
parent
42c33d8951
commit
196f6e755c
@ -18,7 +18,7 @@ Juicescript.command_define({
|
||||
let string = "";
|
||||
for(var q = 1; q <= runner.command.argument.length; q++){
|
||||
// append to string
|
||||
string += runner.argument_value(q).toString();
|
||||
string += runner.stringify(runner.argument_value(q));
|
||||
}
|
||||
|
||||
|
||||
|
@ -408,6 +408,20 @@ class Juicescript_runner {
|
||||
return (this.error_count > 0);
|
||||
}
|
||||
|
||||
/*
|
||||
HELPER: Express VALUE as a string
|
||||
*/
|
||||
stringify(value){
|
||||
// NULL //
|
||||
if(value === null){
|
||||
return "null";
|
||||
}
|
||||
|
||||
|
||||
// TRY JAVASCRIPT'S `toString()` //
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
HELPER: Automagically keep track of problems and add additional info to stderr
|
||||
*/
|
||||
|
Reference in New Issue
Block a user