if (val != NULL) {
if (!njs_value_is_valid_number(val)) {
- njs_vm_error(vm, "is not a number");
+ njs_vm_type_error(vm, "is not a number");
return NJS_ERROR;
}
if (val != NULL) {
if (njs_slow_path(!njs_value_is_function(val))) {
- njs_vm_error(vm, "option decodeURIComponent is not a function");
+ njs_vm_type_error(vm, "option decodeURIComponent is not "
+ "a function");
return NJS_ERROR;
}
val = njs_vm_object_prop(vm, this, &njs_unescape_str, &value);
if (val == NULL || !njs_value_is_function(val)) {
- njs_vm_error(vm, "QueryString.unescape is not a function");
+ njs_vm_type_error(vm, "QueryString.unescape is not a function");
return NJS_ERROR;
}
if (val != NULL) {
if (njs_slow_path(!njs_value_is_function(val))) {
- njs_vm_error(vm, "option encodeURIComponent is not a function");
+ njs_vm_type_error(vm, "option encodeURIComponent is not "
+ "a function");
return NJS_ERROR;
}
val = njs_vm_object_prop(vm, this, &njs_escape_str, &value);
if (val == NULL || !njs_value_is_function(val)) {
- njs_vm_error(vm, "QueryString.escape is not a function");
+ njs_vm_type_error(vm, "QueryString.escape is not a function");
return NJS_ERROR;
}
{ njs_str("var qs = require('querystring');"
"qs.parse('baz=fuz&muz=tax', null, null, {decodeURIComponent: 123});"),
- njs_str("Error: option decodeURIComponent is not a function") },
+ njs_str("TypeError: option decodeURIComponent is not a function") },
{ njs_str("var qs = require('querystring');"
"qs.unescape = 123;"
"qs.parse('baz=fuz&muz=tax');"),
- njs_str("Error: QueryString.unescape is not a function") },
+ njs_str("TypeError: QueryString.unescape is not a function") },
{ njs_str("var qs = require('querystring'); var out = [];"
"qs.unescape = (key) => {out.push(key)};"
{ njs_str("var qs = require('querystring');"
"qs.stringify({'baz': 'fuz', 'muz': 'tax'}, null, null, {encodeURIComponent: 123});"
"out.join('; ')"),
- njs_str("Error: option encodeURIComponent is not a function") },
+ njs_str("TypeError: option encodeURIComponent is not a function") },
{ njs_str("var qs = require('querystring');"
"qs.escape = 123;"
"qs.stringify({'baz': 'fuz', 'muz': 'tax'})"),
- njs_str("Error: QueryString.escape is not a function") },
+ njs_str("TypeError: QueryString.escape is not a function") },
{ njs_str("var qs = require('querystring'); var out = [];"
"qs.escape = (key) => {out.push(key)};"