This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 352bf615a Document yet another SpiderMonkey vs SpiderMonkey 
incompatibility
352bf615a is described below

commit 352bf615a15f9421be97cc26671aead1021ee34d
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Mon Oct 21 13:36:16 2024 -0400

    Document yet another SpiderMonkey vs SpiderMonkey incompatibility
---
 src/docs/src/best-practices/jsdevel.rst | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/docs/src/best-practices/jsdevel.rst 
b/src/docs/src/best-practices/jsdevel.rst
index e323a30dd..8f19673ff 100644
--- a/src/docs/src/best-practices/jsdevel.rst
+++ b/src/docs/src/best-practices/jsdevel.rst
@@ -224,6 +224,29 @@ Spidermonkey 91 output also match QuickJS and v8.
    js> "abc".match(undefined)
    [""]
 
+8. The ``toISOString()`` throws an error on invalid ``Date`` objects.
+
+SpiderMonkey version ``1.8.5`` does not throw an error when calling
+``toISOString()`` on invalid ``Date`` objects, but SpiderMonkey versions at
+least ``78+`` do:
+
+.. code-block:: bash
+
+  % js
+  js>  (new Date(undefined)).toISOString()
+  "Invalid Date"
+
+  % js91
+  js> (new Date(undefined)).toISOString()
+  typein:1:23 RangeError: invalid date
+  Stack:
+    @typein:1:23
+
+This can affect views emitting an invalid date object. Previousy, the view
+might have emitted the "Invalid Date" string, while in later SpiderMonkey
+engines all the emit results from that document will be skipped, since view
+functions skip view results if an exception is thrown.
+
 Using QuickJS
 =============
 

Reply via email to