ret = njs_value_property(vm, value, njs_value_arg(&njs_string_type),
&retval);
if (njs_slow_path(ret != NJS_OK)) {
- return NJS_DECLINED;
+ return ret;
}
ret = njs_value_to_string(vm, &retval, &retval);
if (njs_slow_path(ret != NJS_OK)) {
- return NJS_DECLINED;
+ return ret;
}
njs_string_get(&retval, &str);
ret = njs_value_property(vm, value, njs_value_arg(&njs_string_data),
&retval);
if (njs_slow_path(ret != NJS_OK)) {
- return NJS_DECLINED;
+ return ret;
}
if (njs_is_object(&retval)) {
{ njs_str("njs.dump(Buffer.from(new String('test')))"),
njs_str("Buffer [116,101,115,116]") },
+ { njs_str("Buffer.from({ get type() { throw new Error('test'); } })"),
+ njs_str("Error: test") },
+
+ { njs_str("Buffer.from({ type: 'Buffer', get data() { throw new Error('test'); } })"),
+ njs_str("Error: test") },
+
{ njs_str("["
" ['6576696c', 'hex'],"
" ['ZXZpbA==', 'base64'],"