nickva commented on code in PR #5431:
URL: https://github.com/apache/couchdb/pull/5431#discussion_r1955538066


##########
src/couch/test/eunit/couch_js_tests.erl:
##########
@@ -103,6 +106,26 @@ should_freeze_doc_object(_) ->
     ?assertEqual([[[null, 1041], [null, 1041]]], Result2),
     couch_query_servers:ret_os_process(Proc).
 
+%% erlfmt-ignore
+should_emit_error_details(_) ->
+    Src = <<"
+        function(doc) {
+            try {
+               non_existent.fun_call
+            } catch (e) {
+               log('********* is error instance of error? ' + (e instanceof 
Error));
+               emit('test_error', e);
+            }
+        }
+    ">>,
+    Proc = couch_query_servers:get_os_process(<<"javascript">>),
+    true = prompt(Proc, [<<"add_fun">>, Src]),
+    Doc = {[{<<"foo">>, 42}]},
+    Result = prompt(Proc, [<<"map_doc">>, Doc]),
+    io:format(standard_error, "~n +++++ ~p:~p@~B ~p~n", [?MODULE, 
?FUNCTION_NAME, ?LINE, Result]),
+    ?assertNotEqual([[[<<"test_error">>, {[]}]]], Result),

Review Comment:
   This returns "{}" as `if (value instanceof Error) ` is `false` somehow.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to